★ wanayoo — archive 1999 http://corelinux.sourceforge.net/classref/MutexSemaphore.htmlNouvelle recherche | Portail wanayoo

class corelinux::MutexSemaphore: public Semaphore

MutexSemaphore implements a mutual exclusion control which can be used to insure that at most one (1) task has access at a time.

Inheritance:


Public Methods

[more] MutexSemaphore( SemaphoreGroupPtr, SemaphoreIdentifierRef, bool AutoLock = false, bool Recursive = true, bool Balking = false ) throw( NullPointerException )
Default constructor requires the identifier of the semaphore in the semaphore group
[more]virtual bool isLocked( void )
Ask if semaphore instance is locked
[more]virtual SemaphoreOperationStatus lockWithNoWait( void ) throw(SemaphoreException)
Request the semaphore without waiting
[more]virtual SemaphoreOperationStatus lockWithWait( void ) throw(SemaphoreException)
Request the semaphore, wait for availability
[more]virtual SemaphoreOperationStatus release( void ) throw(SemaphoreException)
Release the semaphore if owner
[more]virtual ~MutexSemaphore( void )
Virtual Destructor

Public

[more]
Request the semaphore but timeout if not available

Protected Methods

[more] MutexSemaphore( MutexSemaphoreCref ) throw( Assertion )
Copy constructor throws assertion
[more] MutexSemaphore( void ) throw( Assertion )
Default construct throws assert
[more]MutexSemaphoreRef operator=( MutexSemaphoreCref ) throw( Assertion )
Assignment operator throws assertion


Inherited from Semaphore:

Public Methods

ovirtual ThreadIdentifierCref getOwningThreadIdentifier( void ) const
ovirtual CounterCref getRecursionQueueLength( void ) const
ovirtual bool isBalkingEnabled( void ) const
ovirtual bool isRecursionEnabled( void ) const
obool operator==( SemaphoreCref aRef ) const

Protected Methods

ovirtual ThreadIdentifierRef getOwnerId( void )
oCounterCref operator++( void )
oCounterCref operator--( void )
ovirtual void resetOwnerId( void )
ovirtual void setOwnerId( void )
ovirtual void setRecursionQueueLength( Counter )


Inherited from AbstractSemaphore:

Public Methods

oSemaphoreGroupIdentifierCref getGroupIdentifier( void ) const
oSemaphoreIdentifierCref getIdentifier( void ) const
oInt getInitialValue( void )
oInt getValue( void )

Protected Methods

oinline Int getGroupId( void ) const
oinline SemaphoreIdentifierRef getId( void )
oSemaphoreOperationStatus setLock( Int )
oSemaphoreOperationStatus setUnlock( Int )
oSemaphoreOperationStatus setValue( Int )


Inherited from Synchronized:

Protected Methods

oGuard access( void ) const throw(SemaphoreException)


Documentation

MutexSemaphore implements a mutual exclusion control which can be used to insure that at most one (1) task has access at a time.

The semantics for Recursion: The thread that is successful is obtaining the lock will be regarded as theOwningThreadIdentifier. If, upon a lock request, it is determined that the same thread that owns the lock is asking to lock again, theRecursionQueueLength will be incremented. It is thereafter neccessary for theOwningThread to release the semaphore until theRecursionQueueLength returns to zero (0). All other callers will block or not based on their lock call disposition.

o MutexSemaphore( SemaphoreGroupPtr, SemaphoreIdentifierRef, bool AutoLock = false, bool Recursive = true, bool Balking = false ) throw( NullPointerException )
Default constructor requires the identifier of the semaphore in the semaphore group
Parameters:
SemaphoreGroup - pointer to the owning SemaphoreGroup
SemaphoreIdentifier - The identifier for the Semaphore from the SemaphoreGroup
bool - true if autolock on creation
bool - true if recursion enabled
bool - true if balking enabled

ovirtual ~MutexSemaphore( void )
Virtual Destructor

ovirtual bool isLocked( void )
Ask if semaphore instance is locked

ovirtual SemaphoreOperationStatus lockWithWait( void ) throw(SemaphoreException)
Request the semaphore, wait for availability

ovirtual SemaphoreOperationStatus lockWithNoWait( void ) throw(SemaphoreException)
Request the semaphore without waiting

o
Request the semaphore but timeout if not available

ovirtual SemaphoreOperationStatus release( void ) throw(SemaphoreException)
Release the semaphore if owner

o MutexSemaphore( void ) throw( Assertion )
Default construct throws assert

o MutexSemaphore( MutexSemaphoreCref ) throw( Assertion )
Copy constructor throws assertion

oMutexSemaphoreRef operator=( MutexSemaphoreCref ) throw( Assertion )
Assignment operator throws assertion


This class has no child classes.



This page was generated with the help of
DOC++.