|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.concurrent.locks.ReentrantReadWriteLock
com.sleepycat.je.latch.Java5SharedLatchImpl
class Java5SharedLatchImpl
Java5SharedLatchImpl provides an implementation of the SharedLatch interface. By using a wrapper class we can avoid link errors when we run in Java 1.4 JVMs. LatchSupport will only reference this class if it knows that the ReentrantReadWriteLock class is available at runtime through Class.forName(). LatchSupport only references this class through the SharedLatch interface and only constructs this using Class.forName("Java5LatchImpl").newInstance();
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.concurrent.locks.ReentrantReadWriteLock |
|---|
ReentrantReadWriteLock.ReadLock, ReentrantReadWriteLock.WriteLock |
| Constructor Summary | |
|---|---|
Java5SharedLatchImpl()
|
|
| 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. |
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(String name)
Set the latch name, used for latches in objects instantiated from the log. |
boolean |
setNoteLatch(boolean noteLatch)
If noteLatch is true, then track latch usage in the latchTable. |
| Methods inherited from class java.util.concurrent.locks.ReentrantReadWriteLock |
|---|
getOwner, getQueuedReaderThreads, getQueuedThreads, getQueuedWriterThreads, getQueueLength, getReadHoldCount, getReadLockCount, getWaitingThreads, getWaitQueueLength, getWriteHoldCount, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isWriteLocked, isWriteLockedByCurrentThread, readLock, toString, writeLock |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.sleepycat.je.latch.SharedLatch |
|---|
isWriteLockedByCurrentThread |
| Constructor Detail |
|---|
Java5SharedLatchImpl()
| Method Detail |
|---|
public void setExclusiveOnly(boolean exclusiveOnly)
SharedLatch
setExclusiveOnly in interface SharedLatchpublic void setName(String name)
setName in interface SharedLatchpublic boolean setNoteLatch(boolean noteLatch)
setNoteLatch in interface SharedLatch
public void acquireExclusive()
throws DatabaseException
acquireExclusive in interface SharedLatchLatchException - if the latch is already held by the current
thread for exclusive access.
DatabaseException
public boolean acquireExclusiveNoWait()
throws DatabaseException
SharedLatch
acquireExclusiveNoWait in interface SharedLatchLatchException - if the latch is already held by the calling
thread.
DatabaseException
public void acquireShared()
throws DatabaseException
acquireShared in interface SharedLatchRunRecoveryException - if an InterruptedException exception
occurs.
DatabaseExceptionpublic boolean isOwner()
SharedLatch
isOwner in interface SharedLatch
public void release()
throws LatchNotHeldException
release in interface SharedLatchLatchNotHeldException
public void releaseIfOwner()
throws LatchNotHeldException
SharedLatch
releaseIfOwner in interface SharedLatchLatchNotHeldException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||