Meant for reentrancy logic.
Meant for reentrancy logic.
true
if this lock is acquired by the current thread or false
otherwise
Returns a new Condition instance that is bound to this Lock instance.
Acquires the lock.
Acquires the lock. Compared to unsafeLock it doesn't do sanity checks, so used unwisely it may lead to deadlocks or other undesired behavior.
If the lock is not available, then the thread waits until is able to acquire the lock. Does not interrupt - for interrupting see lockInterruptibly instead.
Acquires the lock.
Acquires the lock. Compared to lockInterruptibly it doesn't do any sanity checks, so used unwisely it may lead to deadlocks or other undesired behavior.
If the lock is not available, then the thread waits until is able to acquire the lock. Can be interrupted.
in case the lock is already acquired.
InterruptedExceptionin case the thread was interrupted with Thread.interrupt()
Acquires the lock if it is free within the given waiting time and the current thread has not been interrupted.
Acquires the lock if it is free within the given waiting time and the current thread has not been interrupted. Compared to tryLock it doesn't do any sanity checks, so used unwisely it may lead to deadlocks or other undesired behavior.
the maximum time to wait for the lock
the time unit of the time
argument
true
if the lock was successfully acquired or false
if the waiting time
elapsed before the lock was acquired
if the current thread is interrupted while acquiring the lock (and interruption of lock acquisition is supported)
Acquires the lock only if it is free at the time of invocation.
Acquires the lock only if it is free at the time of invocation. Compared to tryLock it doesn't do any sanity checks, so used unwisely it may lead to deadlocks or other undesired behavior.
either true
if the lock was acquired or false
otherwise.
Releases the acquired lock without doing any safety checks.
Acquires the lock.
Acquires the lock.
If the lock is not available, then the thread waits until is able to acquire the lock. Does not interrupt - for interrupting see lockInterruptibly instead.
in case the lock is already acquired.
Acquires the lock.
Acquires the lock.
If the lock is not available, then the thread waits until is able to acquire the lock. Can be interrupted.
in case the lock is already acquired.
InterruptedExceptionin case the thread was interrupted with Thread.interrupt()
Acquires the lock if it is free within the given waiting time and the current thread has not been interrupted.
Acquires the lock if it is free within the given waiting time and the current thread has not been interrupted.
the maximum time to wait for the lock
the time unit of the time
argument
true
if the lock was successfully acquired or false
if the waiting time
elapsed before the lock was acquired
in case the lock is already acquired.
java.lang.InterruptedExceptionif the current thread is interrupted while acquiring the lock (and interruption of lock acquisition is supported)
Acquires the lock only if it is free at the time of invocation.
Acquires the lock only if it is free at the time of invocation.
either true
if the lock was acquired or false
otherwise.
in case the lock is already acquired.
Releases the acquired lock.
Releases the acquired lock.