class JavaLock extends ReentrantLock with Lock
Reentrant lock implementation that uses the jdk.util.concurrent.lock.ReentrantLock
class. If fair
is true then the lock is first-come first-served.
Under heavy contention this can be useful, but it imposes a significant performance penalty on the
acquisition of the lock.
- Alphabetic
- By Inheritance
- JavaLock
- Lock
- ReentrantLock
- Serializable
- Lock
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new JavaLock(fair: Boolean)
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[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
getHoldCount(): Int
- Definition Classes
- ReentrantLock
-
def
getOwner(): Thread
- Attributes
- protected[java.util.concurrent.locks]
- Definition Classes
- ReentrantLock
-
final
def
getQueueLength(): Int
- Definition Classes
- ReentrantLock
-
def
getQueuedThreads(): Collection[Thread]
- Attributes
- protected[java.util.concurrent.locks]
- Definition Classes
- ReentrantLock
-
def
getWaitQueueLength(arg0: java.util.concurrent.locks.Condition): Int
- Definition Classes
- ReentrantLock
-
def
getWaiting: Seq[Thread]
Return an approximate list of the threads waiting to acquire this lock
-
def
getWaitingThreads(arg0: java.util.concurrent.locks.Condition): Collection[Thread]
- Attributes
- protected[java.util.concurrent.locks]
- Definition Classes
- ReentrantLock
-
final
def
hasQueuedThread(arg0: Thread): Boolean
- Definition Classes
- ReentrantLock
-
final
def
hasQueuedThreads(): Boolean
- Definition Classes
- ReentrantLock
-
def
hasWaiters(arg0: java.util.concurrent.locks.Condition): Boolean
- Definition Classes
- ReentrantLock
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isFair(): Boolean
- Definition Classes
- ReentrantLock
-
def
isHeldByCurrentThread(): Boolean
- Definition Classes
- ReentrantLock
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isLocked(): Boolean
- Definition Classes
- ReentrantLock
-
def
lock(): Unit
- Definition Classes
- ReentrantLock → Lock
-
def
lockInterruptibly(): Unit
- Definition Classes
- ReentrantLock → Lock
- Annotations
- @throws( ... )
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
newCondition(): java.util.concurrent.locks.Condition
- Definition Classes
- ReentrantLock → Lock
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
numWaiting: Int
Approximate number of threads waiting to acquire this Lock
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- ReentrantLock → AnyRef → Any
-
def
tryLock(arg0: Long, arg1: TimeUnit): Boolean
- Definition Classes
- ReentrantLock → Lock
- Annotations
- @throws( ... )
-
def
tryLock(): Boolean
- Definition Classes
- ReentrantLock → Lock
-
def
tryLockFor[T](timeoutNS: Long)(body: ⇒ T)(otherwise: ⇒ T): T
Try the lock for up to
timeoutNS
, and if it lock then evaluatebody
else evaluateotherwise
Try the lock for up to
timeoutNS
, and if it lock then evaluatebody
else evaluateotherwise
- Annotations
- @inline()
-
def
unlock(): Unit
- Definition Classes
- ReentrantLock → Lock
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
withLock[T](body: ⇒ T): T
evaluate body with the lock set; finally unset the lock
evaluate body with the lock set; finally unset the lock
- Definition Classes
- Lock
- Annotations
- @inline()