nn::os::Semaphore Classclass Semaphore : public nn::os::InterruptEvent
Class for handling semaphores. Semaphores are synchronization objects that have counters.
Generally, use the nn::os::LightSemaphore class instead of nn::os::Semaphore. The nn::os::LightSemaphore class is better than the nn::os::Semaphore class in most respects, except that it cannot wait for multiple synchronization objects.
The semaphore Wait operation first waits for the semaphore counter to become greater than zero, then increments the semaphore counter by one. Wait operations are not released while the semaphore counter is zero.
Call Release in order to increment a semaphore's counter.
See the reference for the nn::os::Event class for more information about synchronization objects.
You can create up to 8 Semaphore objects. Note also that different functions might use up resources that count against this limit.
Semaphore
|
Constructs and initializes a semaphore. | |
|---|---|---|
Initialize
|
Initializes a semaphore that has already been constructed. | |
TryInitialize
|
Tries to initialize a semaphore that has already been constructed. | |
Finalize
|
Destroys a semaphore. | |
~Semaphore
|
Destructor. | |
Release
|
Releases a semaphore (performs a "V operation") and increases the counter value. | |
Acquire
|
Acquires a semaphore (performs a "P operation") and decrements the counter value. | |
TryAcquire
|
Tries to acquire a semaphore (perform a "P operation"). | |
| S |
GetCurrentCount
|
Gets the number of Semaphore objects that are currently being used. |
| S |
GetMaxCount
|
Gets the maximum number of Semaphore objects that can be used simultaneously. |
nn::util::NonCopyable
nn::os::HandleObject
nn::os::WaitObject
nn::os::InterruptEvent
nn::os::Semaphore
CONFIDENTIAL