void doNotifyIfNecessary ( ) { if ( status . compareAndSet ( ConnectionStatus . RUNNING , ConnectionStatus . RELEASE ) || status . compareAndSet ( ConnectionStatus . TERMINATED , ConnectionStatus . RELEASE ) ) { resourceSynchronizer . doNotify ( ) ; } }
Notify connection to finish wait if necessary .