Waiter object that can block the calling thread until a flag is set.
More...
#include <kanzi/core/util/flag_waiter.hpp>
Waiter object that can block the calling thread until a flag is set.
Similar in semantics to std::atomic_flag from C++ 20.
- Since
- Kanzi 4.0.0
◆ FlagWaiter() [1/2]
| kanzi::FlagWaiter::FlagWaiter |
( |
| ) |
|
|
default |
◆ FlagWaiter() [2/2]
| kanzi::FlagWaiter::FlagWaiter |
( |
bool | initialSignal | ) |
|
|
inlineexplicit |
Constructs a FlagWaiter with a customizable initial state.
- Parameters
-
| initialSignal | The initial state of the flag. |
◆ ~FlagWaiter()
| kanzi::FlagWaiter::~FlagWaiter |
( |
| ) |
|
|
inline |
◆ wait()
| void kanzi::FlagWaiter::wait |
( |
| ) |
|
|
inline |
Block the current thread until the flag is signaled.
◆ clear()
| void kanzi::FlagWaiter::clear |
( |
| ) |
|
|
inline |
Clear the current flag state.
◆ waitAndClear()
| void kanzi::FlagWaiter::waitAndClear |
( |
| ) |
|
|
inline |
Block the current thread until the flag is signaled, and then clear the flag.
◆ signal()
| void kanzi::FlagWaiter::signal |
( |
| ) |
|
|
inline |
Signal the flag and wake all waiting threads.
The documentation for this class was generated from the following file: