public void close ( boolean immediate ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "close" , "" + immediate ) ; synchronized ( queueMonitor ) { if ( immediate || ( totalQueueDepth == 0 ) ) { state = CLOSED ; closeWaitersMonitor . setActive ( false ) ; } else state = CLOSING ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "close" ) ; }
Closes the priority queue . This causes all new queue requests to be ignored . Any existing data that has been queued may be dequeued unless the immediate flag has been set in which case we consider ourselves closed .