void function ( ) { while ( counter == 0 ) { wait ( ) ; } counter = counter - 1 ; }
method called by a thread to acquire the lock . if there are no resources available this will wait until the lock has been released to re-attempt the acquire . concode_field_sep int licenses concode_elem_sep int counter concode_field_sep int getAvailableLicenses concode_elem_sep void release concode_elem_sep int getNumLicenses