class FairMonitor extends AbstractMonitor
A class that provides re-entrant first-come-first-served locking and condition variables
- See also
io.threadcso.monitor.AbstractMonitor for usage
- Alphabetic
- By Inheritance
- FairMonitor
- AbstractMonitor
- Debuggable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new FairMonitor(name: String = null)
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
getWaiting(condition: java.util.concurrent.locks.Condition): Seq[Thread]
Approximate sequence of threads awaiting
condition
.Approximate sequence of threads awaiting
condition
. Yields an empty sequence if this monitor is owned by a thread other than the caller when it is called. The approximation is adequate only for use by a debugger.- Definition Classes
- AbstractMonitor
- Annotations
- @inline()
-
def
getWaiting: Seq[Thread]
The threads waiting for this lock.
The threads waiting for this lock.
- Definition Classes
- AbstractMonitor → Debuggable
-
def
hasState: Boolean
Returns true iff it's owned or somebody's waiting (unlikely to be the latter without the former).
Returns true iff it's owned or somebody's waiting (unlikely to be the latter without the former). Used only in the debugger to detect interesting monitor.
- Definition Classes
- AbstractMonitor → Debuggable
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
val
key: StateKey
This object's key in the registry (if non-negative)
This object's key in the registry (if non-negative)
- Definition Classes
- Debuggable
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
newCondition: java.util.concurrent.locks.Condition
- Definition Classes
- AbstractMonitor
- Annotations
- @inline()
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
register(): Unit
Register this object
Register this object
- Definition Classes
- Debuggable
-
def
showState(out: PrintWriter): Unit
Output the state of an owned and awaited monitor
Output the state of an owned and awaited monitor
- Definition Classes
- AbstractMonitor → Debuggable
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
The current state of the lock
The current state of the lock
- Definition Classes
- AbstractMonitor → AnyRef → Any
-
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
- Definition Classes
- AbstractMonitor
- Annotations
- @inline()
-
def
unregister(): Unit
Unregister this object
Unregister this object
- Definition Classes
- Debuggable
-
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
waitingFor(condition: java.util.concurrent.locks.Condition): Boolean
Approximate answer to the question are any threads awaiting
condition
? Yields false if the monitor is owned by a thread other than the caller when it is called.Approximate answer to the question are any threads awaiting
condition
? Yields false if the monitor is owned by a thread other than the caller when it is called. The approximation is adequate only for use by a debugger.- Definition Classes
- AbstractMonitor
- Annotations
- @inline()
-
def
withDebugger[T](condition: Boolean)(body: ⇒ T): T
Conditionally
register
this object with the debugger only for the duration of the evaluation ofbody
.Conditionally
register
this object with the debugger only for the duration of the evaluation ofbody
. To be used as a last resort for the exasperated CSO toolkit debugger.- Definition Classes
- Debuggable
-
def
withLock[T](body: ⇒ T): T
Evaluate
body
with the lock set; and then unset the lock.Evaluate
body
with the lock set; and then unset the lock. The lock is unset even ifbody
throws an exception.- Definition Classes
- AbstractMonitor
- Annotations
- @inline()