interface LockTable
Modifier and Type | Method and Description |
---|---|
void |
addWaiters(java.util.Map<java.lang.Object,java.lang.Object> waiters)
Add all waiters in the lock table to the specified map.
|
boolean |
anyoneBlocked()
Check whether there are anyone blocked in the lock table.
|
int |
getWaitTimeout()
Get the wait timeout in milliseconds.
|
Lock |
lockObject(CompatibilitySpace compatibilitySpace,
Lockable ref,
java.lang.Object qualifier,
int timeout)
Lock an object.
|
void |
oneLessWaiter()
Notify the lock table that it has one less waiter.
|
void |
oneMoreWaiter()
Notify the lock table that it has one more waiter.
|
void |
setDeadlockTimeout(int timeout)
Set the deadlock timeout.
|
void |
setDeadlockTrace(boolean flag)
Enable or disable tracing of deadlocks.
|
void |
setWaitTimeout(int timeout)
Set the wait timeout.
|
java.util.Map |
shallowClone()
Create a map containing a snapshot of all the (
Lockable ,
LockControl ) pairs in the lock table. |
void |
unlock(Latch item,
int unlockCount)
Unlock an object previously locked by
lockObject() . |
Lock |
unlockReference(CompatibilitySpace space,
Lockable ref,
java.lang.Object qualifier,
java.util.Map group)
Unlock an object once if it is present in the specified group.
|
boolean |
zeroDurationLockObject(CompatibilitySpace space,
Lockable ref,
java.lang.Object qualifier,
int timeout)
Lock an object and release the lock immediately.
|
Lock lockObject(CompatibilitySpace compatibilitySpace, Lockable ref, java.lang.Object qualifier, int timeout) throws StandardException
compatibilitySpace
- the compatibility spaceref
- the object to lockqualifier
- qualifier of the locktimeout
- maximum time to wait in milliseconds
(C_LockFactory.NO_WAIT
means don't wait)null
if the lock
couldn't be obtained immediately and the timeout was NO_WAIT
or LockOwner
had the noWait
flag setStandardException
- if the lock could not be obtainedvoid unlock(Latch item, int unlockCount)
lockObject()
.item
- the lock to unlockunlockCount
- the number of times to unlock the item; or zero,
meaning take the unlock count from the itemLock unlockReference(CompatibilitySpace space, Lockable ref, java.lang.Object qualifier, java.util.Map group)
space
- the compatibility spaceref
- a reference to the locked objectqualifier
- qualifier of the lockgroup
- a map representing the locks in a groupnull
if
the object was not unlockedvoid oneMoreWaiter()
void oneLessWaiter()
boolean anyoneBlocked()
true
if someone is blocked, false
otherwiseboolean zeroDurationLockObject(CompatibilitySpace space, Lockable ref, java.lang.Object qualifier, int timeout) throws StandardException
Lock lock = lockTable.lockObject(space, ref, qualifier, timeout); lockTable.unlock(lock, 1);except that the implementation might be more efficient.
space
- the compatibility spaceref
- a reference to the locked objectqualifier
- qualifier of the locktimeout
- maximum time to wait in milliseconds
(C_LockFactory.NO_WAIT
means don't wait)true
if the object was locked, or
false
if the object couldn't be locked immediately and timeout
was NO_WAIT
or LockOwner
had the noWait
flag setStandardException
- if the lock could not be obtainedjava.util.Map shallowClone()
Lockable
,
LockControl
) pairs in the lock table.void setDeadlockTimeout(int timeout)
timeout
- deadlock timeout in millisecondsvoid setWaitTimeout(int timeout)
timeout
- wait timeout in millisecondsint getWaitTimeout()
void setDeadlockTrace(boolean flag)
flag
- true
enables tracing, false
disables tracingvoid addWaiters(java.util.Map<java.lang.Object,java.lang.Object> waiters)
waiters
- the map to add the waiters toLockControl.addWaiters(java.util.Map<java.lang.Object, java.lang.Object>)
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.