private void notify_writers(){
  if (writerLocks.size() > 0) {
    Object oldest=writerLocks.removeFirst();
    ++currentWriters;
synchronized (oldest) {
      oldest.notify();
    }
  }
}

private void notify_writers ( ) { if ( writerLocks . size ( ) > 0 ) { Object oldest = writerLocks . removeFirst ( ) ; ++ currentWriters ; synchronized ( oldest ) { oldest . notify ( ) ; } } }
notify the writing thread that has been waiting the longest .
