/** * Returns a string identifying this lock, as well as its lock state. * The state, in brackets, includes the String {@code "Write locks ="} * followed by the number of reentrantly held write locks, and the * String {@code "Read locks ="} followed by the number of held * read locks. * * @return a string identifying this lock, as well as its lock state */ @Override public String toString() { return super.toString() + "[Write locks = " + getWriteHoldCount() + ", Read locks = " + getReadLockCount() + "]"; } }
/** * Returns a string identifying this lock, as well as its lock state. * The state, in brackets, includes the String {@code "Write locks ="} * followed by the number of reentrantly held write locks, and the * String {@code "Read locks ="} followed by the number of held * read locks. * * @return a string identifying this lock, as well as its lock state */ @Override public String toString() { return super.toString() + "[Write locks = " + getWriteHoldCount() + ", Read locks = " + getReadLockCount() + "]"; } }