public synchronized void release ( int count ) { used -= count ; if ( used < 0 ) used = 0 ; // no negative number of ticket! if ( logger . isDebugEnabled ( ) ) logger . debug ( "Released " + count + " tickets! (Now " + this . toString ( ) + ")" ) ; notifyAll ( ) ; }
Releases the given number of tickets and notifies potentially waiting threads that new tickets are in the pool .