Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

ReentrantReadWriteLock::NonfairSync Class Reference

Inheritance diagram for ReentrantReadWriteLock::NonfairSync:

ReentrantReadWriteLock::Sync List of all members.

Public Member Functions

void wlock ()

Protected Member Functions

final bool tryAcquire (int acquires)
final int tryAcquireShared (int acquires)

Private Member Functions

bool nonfairTryAcquire (int acquires)
int nonfairTryAcquireShared (int acquires)
final bool tryRelease (int releases)
final bool tryReleaseShared (int releases)
bool isHeldExclusively ()
ConditionObject newCondition ()
Thread getOwner ()
int getReadLockCount ()
bool isWriteLocked ()
int getWriteHoldCount ()
int getCount ()

Private Attributes

Thread owner

Member Function Documentation

final bool tryAcquire int  acquires  )  [inline, protected]
 

Attempts to acquire in exclusive mode. This method should query if the state of the object permits it to be acquired in the exclusive mode, and if so to acquire it.

This method is always invoked by the thread performing acquire. If this method reports failure, the acquire method may queue the thread, if it is not already queued, until it is signalled by a release from some other thread. This can be used to implement method tryLock().

The default implementation throws UnsupportedOperationException

Parameters:
arg the acquire argument. This value is always the one passed to an acquire method, or is the value saved on entry to a condition wait. The value is otherwise uninterpreted and can represent anything you like.
Returns:
true if successful. Upon success, this object has been acquired.

Reimplemented from AbstractLock.

Definition at line 352 of file ReadWriteLock.d.

References ReentrantReadWriteLock::Sync::nonfairTryAcquire().

final int tryAcquireShared int  acquires  )  [inline, protected]
 

Attempts to acquire in shared mode. This method should query if the state of the object permits it to be acquired in the shared mode, and if so to acquire it.

This method is always invoked by the thread performing acquire. If this method reports failure, the acquire method may queue the thread, if it is not already queued, until it is signalled by a release from some other thread.

The default implementation throws UnsupportedOperationException

Parameters:
arg the acquire argument. This value is always the one passed to an acquire method, or is the value saved on entry to a condition wait. The value is otherwise uninterpreted and can represent anything you like.
Returns:
a negative value on failure, zero on exclusive success, and a positive value if non-exclusively successful, in which case a subsequent waiting thread must check availability. (Support for three different return values enables this method to be used in contexts where acquires only sometimes act exclusively.) Upon success, this object has been acquired.

Reimplemented from AbstractLock.

Definition at line 356 of file ReadWriteLock.d.

References ReentrantReadWriteLock::Sync::nonfairTryAcquireShared().

void wlock  )  [inline]
 

Reimplemented from ReentrantReadWriteLock::Sync.

Definition at line 361 of file ReadWriteLock.d.

References AbstractLock::acquire().

bool nonfairTryAcquire int  acquires  )  [inline, inherited]
 

Definition at line 254 of file ReadWriteLock.d.

References Exception, ReentrantReadWriteLock::exclusiveCount(), and ReentrantReadWriteLock::Sync::owner.

Referenced by tryAcquire(), and ReentrantReadWriteLock::WriteLock::tryLock().

int nonfairTryAcquireShared int  acquires  )  [inline, inherited]
 

Definition at line 273 of file ReadWriteLock.d.

References Exception, ReentrantReadWriteLock::exclusiveCount(), and ReentrantReadWriteLock::Sync::owner.

Referenced by tryAcquireShared(), and ReentrantReadWriteLock::ReadLock::tryLock().

final bool tryRelease int  releases  )  [inline, protected, inherited]
 

Attempts to set the state to reflect a release in exclusive mode. This method is always invoked by the thread performing release.

The default implementation throws UnsupportedOperationException

Parameters:
arg the release argument. This value is always the one passed to a release method, or the current state value upon entry to a condition wait. The value is otherwise uninterpreted and can represent anything you like.
Returns:
true if this object is now in a fully released state, so that any waiting threads may attempt to acquire; and false otherwise.

Reimplemented from AbstractLock.

Definition at line 288 of file ReadWriteLock.d.

References Exception, ReentrantReadWriteLock::exclusiveCount(), and ReentrantReadWriteLock::Sync::owner.

final bool tryReleaseShared int  releases  )  [inline, protected, inherited]
 

Attempts to set the state to reflect a release in shared mode. This method is always invoked by the thread performing release. The default implementation throws UnsupportedOperationException.

Parameters:
arg the release argument. This value is always the one passed to a release method, or the current state value upon entry to a condition wait. The value is otherwise uninterpreted and can represent anything you like.
Returns:
true if this object is now in a fully released state, so that any waiting threads may attempt to acquire; and false otherwise.

Reimplemented from AbstractLock.

Definition at line 303 of file ReadWriteLock.d.

References Exception.

bool isHeldExclusively  )  [inline, protected, inherited]
 

Returns true if synchronization is held exclusively with respect to the current (calling) thread. This method is invoked upon each call to a non-waiting ConditionObject method. (Waiting methods instead invoke release.)

The default implementation throws UnsupportedOperationException. This method is invoked internally only within ConditionObject methods, so need not be defined if conditions are not used.

Returns:
true if synchronization is held exclusively; else false

Reimplemented from AbstractLock.

Definition at line 314 of file ReadWriteLock.d.

References ReentrantReadWriteLock::exclusiveCount(), and ReentrantReadWriteLock::Sync::owner.

Referenced by ReentrantReadWriteLock::isWriteLockedByCurrentThread().

ConditionObject newCondition  )  [inline, protected, inherited]
 

Definition at line 321 of file ReadWriteLock.d.

Referenced by ReentrantReadWriteLock::WriteLock::newCondition().

Thread getOwner  )  [inline, protected, inherited]
 

Definition at line 325 of file ReadWriteLock.d.

References ReentrantReadWriteLock::exclusiveCount(), and ReentrantReadWriteLock::Sync::owner.

Referenced by ReentrantReadWriteLock::getOwner(), and ReentrantReadWriteLock::WriteLock::toString().

int getReadLockCount  )  [inline, protected, inherited]
 

Definition at line 331 of file ReadWriteLock.d.

References ReentrantReadWriteLock::sharedCount().

Referenced by ReentrantReadWriteLock::getReadLockCount(), and ReentrantReadWriteLock::ReadLock::toString().

bool isWriteLocked  )  [inline, protected, inherited]
 

Definition at line 335 of file ReadWriteLock.d.

References ReentrantReadWriteLock::exclusiveCount().

Referenced by ReentrantReadWriteLock::isWriteLocked().

int getWriteHoldCount  )  [inline, protected, inherited]
 

Definition at line 339 of file ReadWriteLock.d.

References ReentrantReadWriteLock::exclusiveCount(), and ReentrantReadWriteLock::Sync::owner.

Referenced by ReentrantReadWriteLock::getWriteHoldCount().

int getCount  )  [inline, protected, inherited]
 

Definition at line 345 of file ReadWriteLock.d.

Referenced by ReentrantReadWriteLock::toString().


Member Data Documentation

Thread owner [inherited]
 

Definition at line 242 of file ReadWriteLock.d.

Referenced by ReentrantReadWriteLock::Sync::getOwner(), ReentrantReadWriteLock::Sync::getWriteHoldCount(), ReentrantReadWriteLock::Sync::isHeldExclusively(), ReentrantReadWriteLock::Sync::nonfairTryAcquire(), ReentrantReadWriteLock::Sync::nonfairTryAcquireShared(), and ReentrantReadWriteLock::Sync::tryRelease().


The documentation for this class was generated from the following file:
Generated on Sat Dec 24 17:28:41 2005 for Mango by  doxygen 1.4.0