final class ReentrantLock extends AnyRef
- Alphabetic
- By Inheritance
- ReentrantLock
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hasQueuedFiber(fiberId: FiberId): UIO[Boolean]
Queries whether the given fiber is waiting to acquire this lock.
- lazy val hasQueuedFibers: UIO[Boolean]
Queries whether any fibers are waiting to acquire this lock.
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- lazy val holdCount: UIO[Int]
Queries the number of holds on this lock by the current fiber.
- def isFair: Boolean
Returns true if this lock has fairness set to true.
- lazy val isHeldByCurrentFiber: UIO[Boolean]
Queries if this lock is held by the current fiber.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- lazy val lock: UIO[Unit]
Acquires the lock.
Acquires the lock.
Acquires the lock if it is not held by another fiber and returns immediately, setting the lock hold count to one.
If the current fiber already holds the lock then the hold count is incremented by one and the method returns immediately.
If the lock is held by another fiber then the current fiber is put to sleep until the lock has been acquired, at which time the lock hold count is set to one.
- lazy val locked: UIO[Boolean]
Queries if this lock is held by any fiber.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- lazy val owner: UIO[Option[FiberId]]
Returns the fiber ID of the fiber that currently owns this lock, if owned, or None otherwise.
- lazy val queueLength: UIO[Int]
Returns the number of fibers waiting to acquire this lock.
- lazy val queuedFibers: UIO[List[FiberId]]
Returns the fiber IDs of the fibers that are waiting to acquire this lock.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- lazy val tryLock: UIO[Boolean]
Acquires the lock only if it is not held by another fiber at the time of invocation.
- lazy val unlock: UIO[Unit]
Attempts to release this lock.
Attempts to release this lock.
If the current fiber is the holder of this lock then the hold count is decremented. If the hold count is now zero then the lock is released. If the current thread is not the holder of this lock then nothing happens.
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- lazy val withLock: URIO[Scope, Int]
Acquires and releases the lock as a managed effect.