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

ReentrantLock::FairSync Class Reference

Inheritance diagram for ReentrantLock::FairSync:

ReentrantLock::Sync List of all members.

Public Member Functions

void lock ()

Protected Member Functions

final bool tryAcquire (int acquires)

Private Member Functions

bool nonfairTryAcquire (int acquires)
bool tryRelease (int releases)
bool isHeldExclusively ()
ConditionObject newCondition ()
Thread getOwner ()
int getHoldCount ()
bool isLocked ()

Private Attributes

Thread owner

Member Function Documentation

void lock  )  [inline]
 

Reimplemented from ReentrantLock::Sync.

Definition at line 195 of file ReentrantLock.d.

References AbstractLock::acquire().

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 203 of file ReentrantLock.d.

References AbstractLock::getFirstQueuedThread().

bool nonfairTryAcquire int  acquires  )  [inline, inherited]
 

Definition at line 114 of file ReentrantLock.d.

References ReentrantLock::Sync::owner.

Referenced by ReentrantLock::NonfairSync::tryAcquire(), and ReentrantLock::tryLock().

bool tryRelease int  releases  )  [inline, 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 130 of file ReentrantLock.d.

References ReentrantLock::Sync::owner.

bool isHeldExclusively  )  [inline, 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 143 of file ReentrantLock.d.

References ReentrantLock::Sync::owner.

Referenced by ReentrantLock::isHeldByCurrentThread().

ConditionObject newCondition  )  [inline, inherited]
 

Definition at line 147 of file ReentrantLock.d.

Referenced by ReentrantLock::newCondition().

Thread getOwner  )  [inline, inherited]
 

Definition at line 153 of file ReentrantLock.d.

References ReentrantLock::Sync::owner.

Referenced by ReentrantLock::getOwner(), and ReentrantLock::toString().

int getHoldCount  )  [inline, inherited]
 

Definition at line 159 of file ReentrantLock.d.

References ReentrantLock::Sync::owner.

Referenced by ReentrantLock::getHoldCount().

bool isLocked  )  [inline, inherited]
 

Definition at line 165 of file ReentrantLock.d.

Referenced by ReentrantLock::isLocked().


Member Data Documentation

Thread owner [inherited]
 

Definition at line 101 of file ReentrantLock.d.

Referenced by ReentrantLock::Sync::getHoldCount(), ReentrantLock::Sync::getOwner(), ReentrantLock::Sync::isHeldExclusively(), ReentrantLock::Sync::nonfairTryAcquire(), and ReentrantLock::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