Synchronization auxiliary class that allows one or more threads to wait on a given number of requirements.
More...
#include <plugin_utils.h>
Synchronization auxiliary class that allows one or more threads to wait on a given number of requirements.
Usage: CountDownLatch(count): Create the latch with the number of requirements to wait. wait(): Block until the number of requirements reaches zero. countDown(): Decrease the number of requirements by one.
◆ CountDownLatch()
| CountDownLatch::CountDownLatch |
( |
uint |
count | ) |
|
|
inline |
Create the latch with the number of requirements to wait.
- Parameters
-
| count | The number of requirements to wait |
◆ ~CountDownLatch()
| virtual CountDownLatch::~CountDownLatch |
( |
| ) |
|
|
inlinevirtual |
◆ countDown()
| void CountDownLatch::countDown |
( |
| ) |
|
|
inline |
Decrease the number of requirements by one.
◆ get_error()
| bool CountDownLatch::get_error |
( |
| ) |
|
|
inline |
Get latch release reason.
- Returns
- true the latch was released due to a error false the latch was released on correct termination
◆ getCount()
| uint CountDownLatch::getCount |
( |
| ) |
|
|
inline |
Get current number requirements.
- Returns
- the number of requirements
◆ set_error()
| void CountDownLatch::set_error |
( |
| ) |
|
|
inline |
Set error flag, once this latch is release the waiter can check if it was due to a error or due to correct termination.
◆ wait()
| void CountDownLatch::wait |
( |
ulong |
timeout = 0 | ) |
|
|
inline |
Block until the number of requirements reaches zero.
◆ cond
◆ count
| int CountDownLatch::count |
|
private |
◆ error
| bool CountDownLatch::error |
|
private |
◆ lock
The documentation for this class was generated from the following file: