|
SDL3pp
A slim C++ wrapper for SDL3
|
A means to block multiple threads until a condition is satisfied. More...
Public Member Functions | |
| constexpr | Condition (ConditionRaw resource) noexcept |
| Constructs from raw Condition. | |
| constexpr | Condition (const Condition &other)=delete |
| Copy constructor. | |
| constexpr | Condition (Condition &&other) noexcept |
| Move constructor. | |
| constexpr | Condition (const ConditionRef &other)=delete |
| constexpr | Condition (ConditionRef &&other)=delete |
| Condition () | |
| Create a condition variable. | |
| ~Condition () | |
| Destructor. | |
| constexpr Condition & | operator= (Condition &&other) noexcept |
| Assignment operator. | |
| Condition & | operator= (const Condition &other)=delete |
| Assignment operator. | |
| void | Destroy () |
| Destroy a condition variable. | |
| void | Signal () |
| Restart one of the threads that are waiting on the condition variable. | |
| void | Broadcast () |
| Restart all threads that are waiting on the condition variable. | |
| void | Wait (MutexRef mutex) |
| Wait until a condition variable is signaled. | |
| bool | WaitTimeout (MutexRef mutex, std::chrono::milliseconds timeout) |
| Wait until a condition variable is signaled or a certain time has passed. | |
| constexpr | ResourceBase (RawPointer resource) |
| Constructs from resource pointer. | |
| constexpr | ResourceBase (std::nullptr_t=nullptr) |
| Constructs null/invalid. | |
| Public Member Functions inherited from SDL::ResourceBase< ConditionRaw > | |
| constexpr | ResourceBase (RawPointer resource) |
| Constructs from resource pointer. | |
| constexpr | operator bool () const |
| Converts to bool. | |
| constexpr auto | operator<=> (const ResourceBase &other) const=default |
| Comparison. | |
| constexpr RawConstPointer | operator-> () const noexcept |
| member access to underlying resource pointer. | |
| constexpr RawPointer | get () const noexcept |
| Retrieves underlying resource pointer. | |
| constexpr RawPointer | release () noexcept |
| Retrieves underlying resource pointer and clear this. | |
Additional Inherited Members | |
| Public Types inherited from SDL::ResourceBase< ConditionRaw > | |
| using | RawPointer |
| The underlying raw pointer type. | |
| using | RawConstPointer |
| The underlying const raw pointer type. | |
A means to block multiple threads until a condition is satisfied.
Condition variables, paired with an Mutex, let an app halt multiple threads until a condition has occurred, at which time the app can release one or all waiting threads.
Wikipedia has a thorough explanation of the concept:
https://en.wikipedia.org/wiki/Condition_variable
|
inlineexplicitconstexprnoexcept |
Constructs from raw Condition.
| resource | a ConditionRaw to be wrapped. |
This assumes the ownership, call release() if you need to take back.