/** * Attempts to set the state to reflect a release in exclusive mode. * * <p> * This method is always invoked by the thread performing release. * * @throws IllegalMonitorStateException * if releasing would place this synchronizer in an illegal state. * This exception must be thrown in a consistent fashion for * synchronization to work correctly. */ private final void tryRelease() { if (compareAndSet(1, 0)) { this.sync.clearOwnerThread(); } else { // if system is going down then this can happen in some rare cases getCancelCriterion().checkCancelInProgress(null); throw new IllegalMonitorStateException("lock not held in release"); } }
logger = getDistributedSystem(true).getLogWriterI18n(); getCancelCriterion().checkCancelInProgress(null); msecs -= timeoutMillis; if (logger.warningEnabled()) {