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

Semaphore::FairSync Class Reference

Inheritance diagram for Semaphore::FairSync:

Semaphore::Sync List of all members.

Public Member Functions

 this (int permits)

Protected Member Functions

int tryAcquireShared (int acquires)

Private Member Functions

 this ()
int getPermits ()
int nonfairTryAcquireShared (int acquires)
final bool tryReleaseShared (int releases)
void reducePermits (int reductions)
int drainPermits ()

Detailed Description

Fair version

Definition at line 206 of file Semaphore.d.


Member Function Documentation

this int  permits  )  [inline]
 

Reimplemented from Semaphore::Sync.

Definition at line 207 of file Semaphore.d.

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 211 of file Semaphore.d.

References AbstractLock::getFirstQueuedThread().

this  )  [inline, protected, inherited]
 

Creates a new AbstractLock instance with initial synchronization state of zero.

Definition at line 238 of file LockImpl.d.

int getPermits  )  [inline, inherited]
 

Definition at line 151 of file Semaphore.d.

Referenced by Semaphore::availablePermits(), and Semaphore::toString().

int nonfairTryAcquireShared int  acquires  )  [inline, inherited]
 

Definition at line 155 of file Semaphore.d.

Referenced by Semaphore::tryAcquire(), and Semaphore::NonfairSync::tryAcquireShared().

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 165 of file Semaphore.d.

void reducePermits int  reductions  )  [inline, protected, inherited]
 

Definition at line 173 of file Semaphore.d.

Referenced by Semaphore::reducePermits().

int drainPermits  )  [inline, protected, inherited]
 

Definition at line 181 of file Semaphore.d.

Referenced by Semaphore::drainPermits().


The documentation for this class was generated from the following file:
Generated on Fri Nov 11 18:44:42 2005 for Mango by  doxygen 1.4.0