bookExamples.ch13Threads
Class LockingExample

java.lang.Object
  extended by bookExamples.ch13Threads.LockingExample
All Implemented Interfaces:
java.util.concurrent.locks.ReadWriteLock

public class LockingExample
extends java.lang.Object
implements java.util.concurrent.locks.ReadWriteLock


Constructor Summary
LockingExample()
           
 
Method Summary
 java.util.concurrent.locks.Lock readLock()
          Returns the lock used for reading.
 java.util.concurrent.locks.Lock writeLock()
          Returns the lock used for writing.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LockingExample

public LockingExample()
Method Detail

readLock

public java.util.concurrent.locks.Lock readLock()
Returns the lock used for reading.

Specified by:
readLock in interface java.util.concurrent.locks.ReadWriteLock
Returns:
the lock used for reading.

writeLock

public java.util.concurrent.locks.Lock writeLock()
Returns the lock used for writing.

Specified by:
writeLock in interface java.util.concurrent.locks.ReadWriteLock
Returns:
the lock used for writing.