private boolean endPendingOffer ( ) { int newValue = this . pendingOffers . decrementAndGet ( ) ; // if newValue reaches zero, make sure to always reset "offeringAborted" if ( newValue == 0 ) { // if slotWaitingCanceled was true, then reset it back to false, and // return true to make sure the caller knows to cancel waiting return this . pendingOffersAborted . compareAndSet ( true , false ) ; } else { // if slotWaitingCanceled is true, then return true return this . pendingOffersAborted . get ( ) ; } }
End waiting for a pending offer to be accepted . Decrements pendingOffers by 1 . If pendingOffersAborted is true and pendingOffers reaches 0 then pendingOffersAborted will be reset to false .