This class represents a reentrant lock with the same semantics as
built-in Java synchronized locks: Once a thread has a lock, it can
re-obtain it any number of times without blocking.
Acquires the lock only if it not held by another thread.
true if the lock was free and was acquired by thecurrent thread, or the lock was already held by the currentthread; false otherwise.
Attempts to release this lock. The lock is actually released if at
least as many
ReentrantLock.unlock as
ReentrantLock.lock have been performed
on this
ReentrantLock by the current thread.
throws IllegalMonitorStateExeception if the current thread does not hold
this lock.