public class MutexCV extends CObject implements SyncCV
This class follows DbC(tm) methodology
(Wikipedia).
Where possible, contracts are implement with native's Java
assert.
Modifier and Type | Method and Description |
---|---|
void |
await()
Object's wait replacement, in which:
- the checked exception InterruptedException, is replaced by the unchecked exception ThreadInterruptedException; - supports the registration of waiting threads for interrupt purposes. |
boolean |
await(long millis)
Object's wait replacement, in which:
- the checked exception InterruptedException, is replaced by the unchecked exception ThreadInterruptedException; - supports the registration of waiting threads for interrupt purposes; - timeout expiration can be tested using the method's result. |
void |
broadcast()
Object's nofifyAll replacement.
|
boolean |
lockIsMine()
Is lock owned by me?
|
Mutex |
mutex() |
void |
signal()
Object's nofify replacement.
|
await, interruptWaitingThreads, registerAwaitingThreads, syncronizedLockIsMine
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
interruptWaitingThreads, registerAwaitingThreads
public Mutex mutex()
public void await()
CObject
syncronizedLockIsMine()
- native lock owned by mepublic boolean await(long millis)
CObject
millis >= 0
- non negative timeoutsyncronizedLockIsMine()
- native lock owned by mepublic void signal()
CObject
syncronizedLockIsMine()
- native lock owned by mepublic void broadcast()
CObject
syncronizedLockIsMine()
- native lock owned by mepublic boolean lockIsMine()
CObject
lockIsMine
in interface SyncCV
lockIsMine
in class CObject