org.gjt.sp.util
Class ReadWriteLock
java.lang.Object
org.gjt.sp.util.ReadWriteLock
- public class ReadWriteLock
- extends Object
Implements consumer/producer locking scemantics.
- Version:
- $Id: ReadWriteLock.java,v 1.7 2004/02/14 19:02:49 spestov Exp $
The lock tries to be re-entrant when called from the same thread in some
cases.
The following is ok:
read lock
read lock
read unlock
read unlock
write lock
read lock
read unlock
write unlock
The following is not ok:
read lock
write lock
write unlock
read unlock
write lock
write lock
write unlock
write unlock
- Author:
- Peter Graves
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReadWriteLock
public ReadWriteLock()
readLock
public void readLock()
readUnlock
public void readUnlock()
writeLock
public void writeLock()
writeUnlock
public void writeUnlock()
isWriteLocked
public boolean isWriteLocked()