void give ( NGSession session ) { synchronized ( lock ) { if ( done ) { // session is already signalled shutdown and removed from all collections return ; } workingPool . remove ( session ) ; if ( idlePool . size ( ) < maxIdleSessions ) { idlePool . add ( session ) ; return ; } } session . shutdown ( ) ; }
Returns an NGSession to the pool . The pool may choose to shutdown the thread if idle pool is full .