| java.lang.Object org.apache.derby.impl.services.locks.Lock org.apache.derby.impl.services.locks.ActiveLock
ActiveLock | final public class ActiveLock extends Lock (Code) | | A Lock represents a granted or waiting lock request.
MT - Mutable - Immutable identity : Thread Aware
|
Field 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. | boolean | potentiallyGranted Set to true if the Lock potentially could be granted. | byte | wakeUpNow |
Constructor Summary | |
protected | ActiveLock(Object space, Lockable ref, Object qualifier) Initialize the lock, should be seen as part of the constructor. |
Method Summary | |
protected void | clearPotentiallyGranted() Clear the potentially granted flag. | protected boolean | setPotentiallyGranted() Set the potentially granted flag, returns true if the
flag changed its state. | protected synchronized byte | waitForGrant(int timeout) Wait for a lock to be granted, returns when the lock is granted.
The sleep wakeup scheme depends on the two booleans wakeUpNow & potentiallyGranted.
MT - Single thread required - and assumed to be the thread requesting the lock.
true if the wait ended early (ie. | protected synchronized void | wakeUp(byte why) Wake up anyone sleeping on this lock. |
canSkip | protected boolean canSkip(Code) | | 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 compatability space already holds
a lock on the object.
|
potentiallyGranted | boolean potentiallyGranted(Code) | | Set to true if the Lock potentially could be granted.
MT - mutable - single thread required
|
wakeUpNow | byte wakeUpNow(Code) | | Set to true if the object waiting on this thread should wake up,
MT - mutable - java synchronized(this)
|
ActiveLock | protected ActiveLock(Object space, Lockable ref, Object qualifier)(Code) | | 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 | protected void clearPotentiallyGranted()(Code) | | Clear the potentially granted flag.
MT - single thread required
|
setPotentiallyGranted | protected boolean setPotentiallyGranted()(Code) | | Set the potentially granted flag, returns true if the
flag changed its state.
MT - single thread required
|
waitForGrant | protected synchronized byte waitForGrant(int timeout) throws StandardException(Code) | | Wait for a lock to be granted, returns when the lock is granted.
The sleep wakeup scheme depends on the two booleans wakeUpNow & potentiallyGranted.
MT - Single thread required - and assumed to be the thread requesting the lock.
true if the wait ended early (ie. someone else woke us up). exception: StandardException - timeout, deadlock or thread interrupted |
wakeUp | protected synchronized void wakeUp(byte why)(Code) | | Wake up anyone sleeping on this lock.
MT - Thread Safe
|
Fields inherited from org.apache.derby.impl.services.locks.Lock | int count(Code)(Java Doc)
|
|
|