|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.latch.Latch
public class Latch
Constructor Summary | |
---|---|
Latch(java.lang.String name)
|
Method Summary | |
---|---|
void |
acquire()
Acquire a latch for exclusive/write access. |
boolean |
acquireNoWait()
Acquire a latch for exclusive/write access, but do not block if it's not available. |
LatchStats |
getLatchStats()
|
boolean |
isOwner()
Return true if the current thread holds this latch. |
int |
nWaiters()
Return the number of threads waiting. |
java.lang.Thread |
owner()
Used only for unit tests. |
void |
release()
Release the latch. |
void |
releaseIfOwner()
Release the latch. |
void |
setName(java.lang.String name)
Set the latch name, used for latches in objects instantiated from the log. |
java.lang.String |
toString()
Formats a latch owner and waiters. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Latch(java.lang.String name)
Method Detail |
---|
public void setName(java.lang.String name)
public void acquire() throws DatabaseException
Wait for the latch if some other thread is holding it. If there are threads waiting for access, they will be granted the latch on a FIFO basis. When the method returns, the latch is held for exclusive access.
LatchException
- if the latch is already held by the calling
thread.
RunRecoveryException
- if an InterruptedException exception
occurs.
DatabaseException
public boolean acquireNoWait() throws LatchException
LatchException
- if the latch is already held by the calling
thread.public void releaseIfOwner()
public void release() throws LatchNotHeldException
LatchNotHeldException
- if the latch is not currently held.public boolean isOwner()
public java.lang.Thread owner()
public int nWaiters()
public LatchStats getLatchStats()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |