question: public synchronized boolean readRequestImmediate ( ) { if ( currentWriters == 0 && writerLocks . size ( ) == 0 ) { ++ currentReaders ; return true ; } return false ; }
target:  This version of read() requests read access and returns true if you get it. If it returns false, you may not safely read from the guarded resource. If it returns true, you should do the read, then call readDone in the normal way. Here's an example: public void read() { if( lock.readRequestImmediate() ) { try { // do the read operation here } finally { lock.readDone(); } }else { // couldn't read safely. }