Modifier and Type | Field | 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.
|
(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)
|
Modifier | Constructor | Description |
---|---|---|
protected |
ActiveLock(CompatibilitySpace space,
Lockable ref,
java.lang.Object qualifier) |
Initialize the lock, should be seen as part of the constructor.
|
Modifier and Type | Method | Description |
---|---|---|
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.
|
addWaiters, copy, equals, firstWaiter, getCompatabilitySpace, getCount, getFirstGrant, getGranted, getLock, getLockable, getLockControl, getQualifier, getWaiting, grant, hashCode, isEmpty, isGrantable, shallowClone, unlock, unlock
byte wakeUpNow
boolean potentiallyGranted
protected boolean canSkip
protected ActiveLock(CompatibilitySpace space, Lockable ref, java.lang.Object qualifier)
protected boolean setPotentiallyGranted()
protected void clearPotentiallyGranted()
protected byte waitForGrant(int timeout) throws StandardException
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.
StandardException
- timeout, deadlock or thread interruptedprotected void wakeUp(byte why)
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.