/** * Attempts to set the state to reflect a release in exclusive mode. * * <p> * This method is always invoked by the thread performing release. * * <p> * All arguments to this method are ignored and are only there to satisfy the * {@link TryLockObject} interface. * * @return {@code true} if this object is now in a fully released state, so * that any waiting threads may attempt to acquire; and {@code false} * otherwise. * * @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. */ public final boolean tryRelease(int arg, Object ownerId, Object context) { tryRelease(); return true; }
/** * Releases the lock previously acquired by a call to * {@link #attemptLock(long)}. Implemented by unblocking one or more threads. * * @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. */ public final void releaseLock() { tryRelease(); this.sync.signalWaiters(); }
/** * @see Lock#unlock() */ public final void unlock() { tryRelease(); this.sync.signalWaiters(); }