java::util::ReadWriteLock Class Reference

Inheritance diagram for java::util::ReadWriteLock:

Inheritance graph
java::util::PreferenceLockjava::lang::Interfacejava::lang::Object
[legend]
Collaboration diagram for java::util::ReadWriteLock:

Collaboration graph
java::lang::Interfacejava::lang::Object
[legend]

List of all members.


Detailed Description

ReadWriteLocks maintain a pair of associated locks.

The readLock may be held simultanously by multiple reader threads, so long as there are no writers. The writeLock is exclusive. ReadWrite locks are generally preferable to plain Sync locks or synchronized methods in cases where:

Different implementation classes differ in policies surrounding which threads to prefer when there is contention. By far, the most commonly useful policy is WriterPreferenceReadWriteLock. The other implementations are targeted for less common, niche applications.

Author:
Yuh-Jye Chang
Version:
1.0, 05/23/03
Since:
DK1.0

Public Member Functions

virtual Ref< Lockreader () const =0
 Get the read lock.
virtual Ref< Lockwriter () const =0
 Get the read lock.

Member Function Documentation

virtual Ref<Lock> java::util::ReadWriteLock::reader (  )  const [pure virtual]

Get the read lock.

Returns:
the read lock.

Implemented in java::util::PreferenceLock.

virtual Ref<Lock> java::util::ReadWriteLock::writer (  )  const [pure virtual]

Get the read lock.

Returns:
the read lock.

Implemented in java::util::PreferenceLock.


The documentation for this class was generated from the following file:
Generated on Fri May 16 11:56:51 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3