Semaphore object of multi-thread programming.
- This works same as System.Threading.Semaphore of .Net Framework.
PROUD_API Proud::Semaphore::Semaphore |
( |
int |
initialCount, |
|
|
int |
maxCount |
|
) |
| |
Creator
- Parameters
-
initialCount | the initial value that semaphore object will have. |
maxCount | the maximum value that semaphore object can have. |
PROUD_API Proud::Semaphore::~Semaphore |
( |
| ) |
|
PROUD_API void Proud::Semaphore::Release |
( |
int |
releaseCount = 1 | ) |
|
TODO:translate needed. Increase the internal count with a certain value.
- Parameters
-
releaseCount | Value to be increased |
- Returns
- Internal value of semaphore before the increase.
bool Proud::Semaphore::WaitOne |
( |
| ) |
|
|
inline |
It waits endlessly untill the internal counte becomes higher than 1. If the count becomes higher than 1, it reduces the count by 1 and returns.
PROUD_API bool Proud::Semaphore::WaitOne |
( |
uint32_t |
timeOut | ) |
|
It waits for a specific time until the internal count becomes higher than 1. If the count becomes higher than 1, it reduces the count by 1 and returns.
- Parameters
-
timeOut | (millisecond) The maximum waiting time for signal standby. Input INFINITE if you want it to wait endlessly. |