public PermitsPool removeListener ( AvailabilityListener listener ) { synchronized ( listeners ) { for ( Iterator < WeakReference < AvailabilityListener > > iter = listeners . iterator ( ) ; iter . hasNext ( ) ; ) { WeakReference < AvailabilityListener > item = iter . next ( ) ; if ( item . get ( ) == null || item . get ( ) == listener ) { iter . remove ( ) ; } } } return this ; }
Removes the listener .