public synchronized void readRequest(){
  if (currentWriters == 0 && writerLocks.size() == 0) {
    ++currentReaders;
  }
 else {
    ++queuedReaders;
    try {
      wait();
    }
 catch (    InterruptedException e) {
    }
  }
}

public synchronized void readRequest ( ) { if ( currentWriters == 0 && writerLocks . size ( ) == 0 ) { ++ currentReaders ; } else { ++ queuedReaders ; try { wait ( ) ; } catch ( InterruptedException e ) { } } }
request the read lock . block until a read operation can be performed safely . this call must be followed by a call to readdone ( ) when the read operation completes .
