Extension SDK

oracle.ide.util
Class ReadWriteLock

java.lang.Object
  extended byoracle.ide.util.ReadWriteLock

public class ReadWriteLock
extends java.lang.Object

Instances of this class manage read and write locks.


Constructor Summary
ReadWriteLock()
           
 
Method Summary
 void done()
          Threads call this method to relinquish a lock that they previously got from this object.
 void readLock()
          Issue a read lock if there is no outstanding write lock or threads waiting to get a write lock.
 void writeLock()
          Issue a write lock if there are no outstanding read or write locks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadWriteLock

public ReadWriteLock()
Method Detail

readLock

public void readLock()
              throws java.lang.InterruptedException
Issue a read lock if there is no outstanding write lock or threads waiting to get a write lock.

Throws:
java.lang.InterruptedException

writeLock

public void writeLock()
               throws java.lang.InterruptedException
Issue a write lock if there are no outstanding read or write locks.

Throws:
java.lang.InterruptedException

done

public void done()
Threads call this method to relinquish a lock that they previously got from this object.

Throws:
java.lang.IllegalStateException - if called when there are no outstanding locks or there is a write lock issued to a different thread.

Extension SDK

 

Copyright ©1997, 2003, Oracle. All rights reserved.