corelinux_Semaphore3
A semaphore supports the protocol that processes and/or threads agree to follow for the purpose of controlled access to a resource.
Usage
Inherits corelinux::AbstractSemaphore.
Inherited by
corelinux::EventSemaphore,
corelinux::GatewaySemaphore,
corelinux::GuardSemaphore,
and
corelinux::MutexSemaphore.
Public Member Functions
Semaphore (SemaphoreGroupPtr,
SemaphoreIdentifierRef,
bool
Recursive=false,
bool
Balking=false)
throw
(
NullPointerException
)
Virtual Destructor.
bool
operator==
(SemaphoreCref
aRef)
const
Protected Member Functions
Semaphore (void)
throw
(Assertion)
Operator for
increasing
theRecursionQueueLength.
CounterCref
operator--
(void)
Operator for
decreasing
theRecursionQueueLength.
virtual
ThreadIdentifierRef
getOwnerId
(void)
Detailed Description
A Semaphore supports the protocol that processes and/or threads agree to follow for the purpose of controlled access to a resource.
The resource can be anything that the developer considers to need access controls on such as memory, hardware, methods, computer instructions, and so on.
Callers can elect to avoid being put into a blocked state and return immediately without control to the resource. Callers may also request that they are put into a blocked state for a specified amount of time. If, at the end of the specified time, the request has not been satisfied, it is returned with a Timeout indicator.
The owner or creator of the semaphore can elect to enforce balking behavior on a Semaphore. When so designated, the Semaphore can turn back any request until some condition in their solution space is met regardless of the callers blocking options. If a caller access attempt is balked, is it returned with a Balked indicator.
Constructor & Destructor Documentation
corelinux::Semaphore::Semaphore (SemaphoreGroupPtr, SemaphoreIdentifierRef, bool Recursive = false, bool Balking = false) throw ( NullPointerException )
Default constructor requires the identifier of the semaphore in the semaphore group. Parameters:
SemaphoreGroupPtr The owning SemaphoreGroup
SemaphoreIdentifier The identifier from the Semaphore Group
bool true if recursion enabled
bool true if balking enabled
History
- Debian 3.1 (Sarge): the text shown here
- Debian 3.0 (Woody)