ReentrantLock
public class ReentrantLock extends Object implements Lock, Serializable
A ReentrantLock is owned by the thread last successfully locking, but not yet unlocking it. A thread invoking lock
will return, successfully acquiring the lock, when the lock is not owned by another thread. The method will return immediately if the current thread already owns the lock.
if (lock.tryLock() ||
lock.tryLock(timeout, unit)) {
...
}