PixelLightAPI
.
|
Counting semaphore class. More...
#include <Semaphore.h>
Public Member Functions | |
PLCORE_API | Semaphore (uint32 nValue, uint32 nMaxValue) |
Constructor. | |
PLCORE_API | ~Semaphore () |
Destructor. | |
bool | Lock () |
Locks the semaphore. | |
bool | TryLock (uint64 nTimeout) |
Locks the semaphore, but only wait until timeout. | |
bool | Unlock () |
Unlocks the semaphore. | |
uint32 | GetValue () const |
Gets the current value of the semaphore. |
Counting semaphore class.
PLCORE_API PLCore::Semaphore::Semaphore | ( | uint32 | nValue, |
uint32 | nMaxValue | ||
) |
[in] | nValue | Initial value of the semaphore (usually >0) |
[in] | nMaxValue | Maximum value of the semaphore |
PLCORE_API PLCore::Semaphore::~Semaphore | ( | ) |
Destructor.
bool PLCore::Semaphore::Lock | ( | ) | [inline] |
Locks the semaphore.
bool PLCore::Semaphore::TryLock | ( | uint64 | nTimeout | ) | [inline] |
Locks the semaphore, but only wait until timeout.
[in] | nTimeout | Timeout in milliseconds |
bool PLCore::Semaphore::Unlock | ( | ) | [inline] |
Unlocks the semaphore.
uint32 PLCore::Semaphore::GetValue | ( | ) | const [inline] |
Gets the current value of the semaphore.
|