Concurrent.ReentrantLock
enum ReentrantLockSourcecase ReentrantLock(java.util.concurrent.locks.ReentrantLock)A wrapper around a Java ReentrantLock.
Definitions
def isFair(lock: ReentrantLock): Bool
SourceReturns true if this lock has fairness set true.
def lock(lock: ReentrantLock): Unit \ IO
SourceAcquires the lock.
def lockInterruptibly(lock: ReentrantLock): Result[java.lang.InterruptedException, Unit] \ IO
SourceAcquires the lock unless the current thread is interrupted.
def newCondition(lock: ReentrantLock): Condition \ IO
SourceReturns a Condition instance for use with this Lock instance.
def newLock(fair: Bool): ReentrantLock \ IO
SourceCreates an instance of ReentrantLock with the given fairness policy.
fair = False is the default for Java.
def tryLock(lock: ReentrantLock): Bool \ IO
SourceAcquires the lock only if it is not held by another thread at the time of invocation.
def tryLockNanos(lock: ReentrantLock, nanosTimeout: Int64): Result[java.lang.InterruptedException, Bool] \ IO
SourceAcquires the lock if it is not held by another thread within the given waiting time (nanos) and the current thread has not been interrupted.
def unlock(lock: ReentrantLock): Result[java.lang.IllegalMonitorStateException, Unit] \ IO
SourceAttempts to release this lock.