| Modifier and Type | Field and Description |
|---|---|
| protected boolean | canSkip
If true then this lock can be granted even if it is not the first lock request on the wait queue. |
| pack-priv boolean | potentiallyGranted
Set to true if the Lock potentially could be granted. |
| pack-priv byte | wakeUpNow
Set to true if the object waiting on this thread should wake up, MT - mutable - java synchronized(this) |
| Access | Constructor and Description |
|---|---|
| protected | ActiveLock(CompatibilitySpace space, Lockable ref, Object qualifier)
Initialize the lock, should be seen as part of the constructor. |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| protected boolean | setPotentiallyGranted()
Set the potentially granted flag, returns true if the flag changed its state. |
| protected synchronized byte | Returns: true if the wait ended early (ie. someone else woke us up).Wait for a lock to be granted, returns when the lock is granted. |
| protected synchronized void |
| canSkip | back to summary |
|---|---|
| protected boolean canSkip If true then this lock can be granted even if it is not the first lock request on the wait queue. This can occur if the compatibility space already holds a lock on the object. | |
| potentiallyGranted | back to summary |
|---|---|
| pack-priv boolean potentiallyGranted Set to true if the Lock potentially could be granted. MT - mutable - single thread required | |
| wakeUpNow | back to summary |
|---|---|
| pack-priv byte wakeUpNow Set to true if the object waiting on this thread should wake up, MT - mutable - java synchronized(this) | |
| ActiveLock | back to summary |
|---|---|
| protected ActiveLock(CompatibilitySpace space, Lockable ref, Object qualifier) Initialize the lock, should be seen as part of the constructor. A future version of this class may become mutable - mutable identity. MT - single thread required | |
| clearPotentiallyGranted | back to summary |
|---|---|
| protected void clearPotentiallyGranted() Clear the potentially granted flag. MT - single thread required | |
| setPotentiallyGranted | back to summary |
|---|---|
| protected boolean setPotentiallyGranted() Set the potentially granted flag, returns true if the flag changed its state. MT - single thread required | |
| waitForGrant | back to summary |
|---|---|
| protected synchronized byte waitForGrant(int timeout) throws StandardException Wait for a lock to be granted, returns when the lock is granted. The sleep wakeup scheme depends on the two booleans wakeUpNow and potentiallyGranted. MT - Single thread required - and assumed to be the thread requesting the lock.
| |
| wakeUp | back to summary |
|---|---|
| protected synchronized void wakeUp(byte why) Wake up anyone sleeping on this lock. MT - Thread Safe | |