csSemaphore Class Reference
A semaphore object. More...
#include <csutil/thread.h>
Inheritance diagram for csSemaphore:

Public Member Functions | |
virtual char const * | GetLastError () const =0 |
Return the last error description, else 0 if there was none. | |
virtual bool | LockTry ()=0 |
Lock the semaphore if not already locked by some other entity. | |
virtual bool | LockWait ()=0 |
Lock the semaphore. | |
virtual bool | Release ()=0 |
Unlock the semaphore. | |
virtual uint32 | Value ()=0 |
Retrieve the present value of the semaphore. | |
Static Public Member Functions | |
static csRef< csSemaphore > | Create (uint32 value=0) |
Create a semaphore with some initial value. |
Detailed Description
A semaphore object.
Definition at line 228 of file thread.h.
Member Function Documentation
|
Create a semaphore with some initial value.
|
|
Return the last error description, else 0 if there was none.
|
|
Lock the semaphore if not already locked by some other entity. Does not suspend the thread waiting for the lock. If lock succeeded, returns true. If lock failed, immediately returns false. Each successful call to LockTry() must be balanced with a call to Release(). |
|
Lock the semaphore. Suspends execution of the thread until the mutex can be locked. Each LockWait() must be balanced by a call to Release(). Returns true if locking succeeded. Returns false if locking failed for some catastrophic reason; check GetLastError(). |
|
Unlock the semaphore. Each successful call to LockWait() or LockTry() must be balanced by a call to Release(). Returns true if unlocking succeeded. Returns false if unlocking failed for some catastrophic reason; check GetLastError(). |
|
Retrieve the present value of the semaphore.
|
The documentation for this class was generated from the following file:
- csutil/thread.h
Generated for Crystal Space by doxygen 1.4.6