|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.services.locks.Lock
org.apache.derby.impl.services.locks.ActiveLock
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. |
(package private) boolean |
potentiallyGranted
Set to true if the Lock potentially could be granted. |
(package private) byte |
wakeUpNow
Set to true if the object waiting on this thread should wake up, MT - mutable - java synchronized(this) |
Fields inherited from class org.apache.derby.impl.services.locks.Lock |
count |
Constructor Summary | |
protected |
ActiveLock(java.lang.Object space,
Lockable ref,
java.lang.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 byte |
waitForGrant(int timeout)
Wait for a lock to be granted, returns when the lock is granted. |
protected void |
wakeUp(byte why)
Wake up anyone sleeping on this lock. |
Methods inherited from class org.apache.derby.impl.services.locks.Lock |
addWaiters, copy, equals, firstWaiter, getCompatabilitySpace, getCount, getFirstGrant, getGranted, getLock, getLockable, getLockControl, getQualifier, getWaiting, grant, hashCode, isEmpty, isGrantable, shallowClone, unlock, unlock |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
byte wakeUpNow
boolean potentiallyGranted
protected boolean canSkip
Constructor Detail |
protected ActiveLock(java.lang.Object space, Lockable ref, java.lang.Object qualifier)
Method Detail |
protected boolean setPotentiallyGranted()
protected void clearPotentiallyGranted()
protected byte waitForGrant(int timeout) throws StandardException
The sleep wakeup scheme depends on the two booleans wakeUpNow & potentiallyGranted. MT - Single thread required - and assumed to be the thread requesting the lock.
StandardException
- timeout, deadlock or thread interruptedprotected void wakeUp(byte why)
|
Built on Mon 2007-06-04 09:58:47+0400, from revision ??? | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |