|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SharedLatch
Simple thread-based non-transactional reader-writer/shared-exclusive latch. Latches provide simple exclusive or shared transient locks on objects. Latches are expected to be held for short, defined periods of time. No deadlock detection is provided so it is the caller's responsibility to sequence latch acquisition in an ordered fashion to avoid deadlocks.
Method Summary | |
---|---|
void |
acquireExclusive()
Acquire a latch for exclusive/write access. |
boolean |
acquireExclusiveNoWait()
Probe a latch for exclusive access, but don't block if it's not available. |
void |
acquireShared()
Acquire a latch for shared/read access. |
boolean |
isOwner()
Return true if this thread is an owner, reader, or write. |
boolean |
isWriteLockedByCurrentThread()
|
void |
release()
Release an exclusive or shared latch. |
void |
releaseIfOwner()
Release the latch. |
void |
setExclusiveOnly(boolean exclusiveOnly)
Indicate whether this latch can only be set exclusively (not shared). |
void |
setName(java.lang.String name)
Set the latch name, used for latches in objects instantiated from the log. |
boolean |
setNoteLatch(boolean noteLatch)
Indicate whether this latch should be tracked in the debugging LatchSupport.latchTable. |
Method Detail |
---|
void setName(java.lang.String name)
boolean setNoteLatch(boolean noteLatch)
void setExclusiveOnly(boolean exclusiveOnly)
void acquireExclusive() throws DatabaseException
LatchException
- if the latch is already held by the current
thread for shared access.
DatabaseException
boolean acquireExclusiveNoWait() throws DatabaseException
LatchException
- if the latch is already held by the calling
thread.
DatabaseException
void acquireShared() throws DatabaseException
RunRecoveryException
- if an InterruptedException exception
occurs.
DatabaseException
void release() throws LatchNotHeldException
LatchNotHeldException
boolean isWriteLockedByCurrentThread()
void releaseIfOwner() throws LatchNotHeldException
LatchNotHeldException
boolean isOwner()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |