class SimpleLock extends BooleanSemaphore with Lock
A boolean semaphore viewed as a non-reentrant lock implementation
- Alphabetic
- By Inheritance
- SimpleLock
- Lock
- BooleanSemaphore
- Semaphore
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
SimpleLock(name: String = null, parent: AnyRef = null)
- name
the name of the lock (for the debugger).
- parent
the component (if any) in which the mutex will be used (for the debugger).
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
-
def
acquire(): Unit
Wait until the semaphore is unlocked.
Wait until the semaphore is unlocked. If the acquiring thread is cancelled during the wait or the semaphore's
cancel()
method has been called, then rethrow the cancel.- Definition Classes
- BooleanSemaphore → Semaphore
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
val
available: Boolean
- Definition Classes
- BooleanSemaphore
-
def
cancel(): Unit
"Interrupt" each thread waiting to acquire this semaphore, causing the
acquire
to terminate, withcancelled()
true."Interrupt" each thread waiting to acquire this semaphore, causing the
acquire
to terminate, withcancelled()
true.- Definition Classes
- BooleanSemaphore → Semaphore
-
def
cancelled(): Boolean
true if the semaphore has been cancelled during an
acquire
.true if the semaphore has been cancelled during an
acquire
.- Definition Classes
- BooleanSemaphore → Semaphore
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
down(): Unit
same as acquire
same as acquire
- Definition Classes
- Semaphore
- Annotations
- @inline()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
val
fair: Boolean
- Definition Classes
- BooleanSemaphore
-
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
getWaiting: Seq[Thread]
Return an (approximate) list of the threads waiting to acquire a token from this semaphore.
Return an (approximate) list of the threads waiting to acquire a token from this semaphore. Intended for use only by diagnostic components.
- Definition Classes
- BooleanSemaphore → Semaphore
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
lock(): Unit
- Definition Classes
- SimpleLock → Lock
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
val
parent: AnyRef
- Definition Classes
- BooleanSemaphore
-
def
release(): Unit
Unlock the semaphore and permit an
acquire
ing process to proceed.Unlock the semaphore and permit an
acquire
ing process to proceed.- Definition Classes
- BooleanSemaphore → Semaphore
-
def
remaining(): Int
Approximation to the number of acquires that could now succeed without having to wait.
Approximation to the number of acquires that could now succeed without having to wait. Intended for use only by diagnostic components.
- Definition Classes
- BooleanSemaphore → Semaphore
-
val
spin: Int
- Definition Classes
- BooleanSemaphore
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- BooleanSemaphore → AnyRef → Any
-
def
tryAcquire(timeoutNS: Long): Boolean
Wait until the semaphore becomes available (returning true) or until the specified timeout has elapsed (returning false).
Wait until the semaphore becomes available (returning true) or until the specified timeout has elapsed (returning false). Unlike
java.util.concurrent.Semaphore
an invoking thread that needs to wait joins the queue of waiting threads -- threads with shorter timeouts are not prioritised over those with longer deadlines or no deadline. If the acquiring thread is cancelled during the wait or the semaphore'scancel()
method has been called, then thecancelled()
method will return true.- Definition Classes
- BooleanSemaphore → Semaphore
-
def
unlock(): Unit
- Definition Classes
- SimpleLock → Lock
-
def
up(): Unit
same as release
same as release
- Definition Classes
- Semaphore
- Annotations
- @inline()
-
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()