this method will acquire a permit from semaphore if there is an available lock or else it will block for the locks to become available . concode_field_sep int acquiredPermit concode_elem_sep int capacity concode_field_sep void release concode_elem_sep int getAcquiredPermitCount concode_elem_sep int getAvailablePermitCount
void function ( ) { while ( acquiredPermit == ( capacity ) ) { wait ( ) ; } acquiredPermit ++ ; }