00001 class Reader 00002 { 00003 ReadWriteLock rw; 00004 00005 public Reader(ReadWriteLock rw) 00006 { 00007 this.rw = rw; 00008 } 00009 00010 public void read () 00011 { 00012 this.rw.readLock().acquire(); 00013 java.lang.System.out.println("Start reading..."); 00014 java.lang.System.out.println("Finish reading..."); 00015 this.rw.readLock().release(); 00016 } 00017 }