public final boolean isLocked() { return getState() == 1; }
/** * Returns a string identifying this synchronizer's state. The state, in * brackets, includes the String {@code "State="} followed by the current * value of {@link #getState}. * * @return a string identifying the state of this synchronizer */ @Override public String toString() { final StringBuilder sb = new StringBuilder(getClass().getSimpleName()); sb.append('@').append(Integer.toHexString(hashCode())).append(','); return this.sync.toObjectString(sb).append("(lockState=0x") .append(Integer.toHexString(getState())).append(')').toString(); }