zeus::TSemaphore Class Reference
#include <Semaphore.h>
List of all members.
Detailed Description
This class wrapps a semaphore kernel-object.
Constructor & Destructor Documentation
| TSemaphore::TSemaphore |
( |
Uint |
uiInitValue = 0 |
) |
|
Creates a semaphore
- Parameters:
-
| uiInitValue | : initial value of the semaphore |
| TSemaphore::TSemaphore |
( |
const TString & |
rName, |
|
|
Uint |
uiInitValue = 0, |
|
|
bool |
bOpenExisting = false | |
|
) |
| | |
Creates an named semaphore. This is needed if the semaphore is shared between different processes.
- Parameters:
-
| rName | : Name of the semaphore |
| uiInitValue | : initial value of the semaphore |
| bOpenExisting | : Opens the semaphore only if it exists already |
| TSemaphore::~TSemaphore |
( |
|
) |
[protected, virtual] |
Member Function Documentation
| bool TSemaphore::acquire |
( |
|
) |
|
Acquires a permit. The method fails if a thread tries to terminate.
- Return values:
-
| true,: | permit is acquired |
| false,: | failed |
| bool TSemaphore::acquire |
( |
Int |
iPermits |
) |
|
Blocks until all n permits are acquired. This call either aquires all permits or none.
- Parameters:
-
| iPermits | : numbers of permits |
- Return values:
-
| true,: | all permits are acquired |
| false,: | failed |
| bool zeus::TSemaphore::existedAlready |
( |
|
) |
const [inline] |
checks if the semaphore already existed
| void TSemaphore::free |
( |
|
) |
|
| void zeus::TSemaphore::free |
( |
Int |
iPermits |
) |
[inline] |
| Int TSemaphore::getAvailablePermits |
( |
|
) |
const |
returns the number of available permits
| bool zeus::TSemaphore::hasError |
( |
|
) |
const [inline] |
returns true if the semaphore has an error
| bool zeus::TSemaphore::isLocked |
( |
|
) |
const [inline] |
Tests if the semaphore is locked
| bool zeus::TSemaphore::isNamed |
( |
|
) |
const [inline] |
returns true if the object has been named
| bool TSemaphore::tryAcquire |
( |
|
) |
|
tries to acquires a permit. If no permit can be acquired the method returns immediately.
- Return values:
-
| true | : lock was acquired |
| false | : Could not acquire a lock |
| bool TSemaphore::tryAcquire |
( |
const Float & |
rfTimeOut |
) |
|
tries to acquires a permit. If no permit can be acquired the method returns after [fTimeOut] secs.
- Parameters:
-
| fTimeOut | : Time out for waiting for locks |
- Return values:
-
| true | : lock was acquired |
| false | : Could not acquire a lock |
The documentation for this class was generated from the following files: