|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.slamd.common.RefCountMutex
public class RefCountMutex
This class implements a mutex based on reference counts so that multiple readers may hold the lock at the same time, but a writer must have exclusive access to the lock (that is, no read locks may be in use while a write lock is held).
| Constructor Summary | |
|---|---|
RefCountMutex()
Creates a new reference count mutex. |
|
RefCountMutex(boolean debugMode)
Creates a new reference count mutex, optionally operating in debug mode. |
|
| Method Summary | |
|---|---|
void |
debugPrint(java.lang.String message)
Prints the specified message to standard error if debug mode is enabled. |
void |
getReadLock()
Obtains a read lock. |
void |
getWriteLock()
Obtains a write lock. |
void |
getWriteLock(long timeout)
Obtains a write lock. |
void |
releaseReadLock()
Releases a previously obtained read lock. |
void |
releaseWriteLock()
Releases a previously obtained write lock. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RefCountMutex()
public RefCountMutex(boolean debugMode)
debugMode - Indicates debug logging should be performed.| Method Detail |
|---|
public void getReadLock()
public void releaseReadLock()
public void getWriteLock()
public void getWriteLock(long timeout)
throws java.lang.InterruptedException
timeout - The maximum length of time (in milliseconds) to wait on
the write lock.
java.lang.InterruptedException - If the write lock could not be obtained
before the timeout occurred.public void releaseWriteLock()
public void debugPrint(java.lang.String message)
message - The message to be printed.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||