|
| ConditionBase () |
| Create 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 (MutexBase &mutex) |
| Wait until a condition variable is signaled.
|
|
bool | WaitTimeout (MutexBase &mutex, std::chrono::milliseconds timeout) |
| Wait until a condition variable is signaled or a certain time has passed.
|
|
constexpr | Resource (T resource={}) |
| Constructs the underlying resource.
|
|
constexpr | Resource (std::nullptr_t) |
| Equivalent to default ctor.
|
|
constexpr | Resource (std::nullopt_t) |
| Equivalent to default ctor.
|
|
| Resource (const Resource &other)=delete |
|
| Resource (Resource &&other)=delete |
|
constexpr | Resource (SDL_Condition * resource={}) |
| Constructs the underlying resource.
|
|
constexpr | Resource (std::nullptr_t) |
| Equivalent to default ctor.
|
|
constexpr | Resource (std::nullopt_t) |
| Equivalent to default ctor.
|
|
| Resource (const Resource &other)=delete |
|
| Resource (Resource &&other)=delete |
|
Resource & | operator= (const Resource &other)=delete |
|
Resource & | operator= (Resource &&other)=delete |
|
constexpr | operator bool () const |
| True if contains a valid resource.
|
|
constexpr bool | operator== (const Resource &other) const=default |
| Comparison.
|
|
constexpr bool | operator== (std::nullopt_t) const |
| Comparison.
|
|
constexpr bool | operator== (std::nullptr_t) const |
| Comparison.
|
|
constexpr SDL_Condition * | get () const |
| Return contained resource;.
|
|
constexpr SDL_Condition * | release (SDL_Condition * newResource={}) |
| Return contained resource and empties or replace value.
|
|
constexpr const SDL_Condition * | operator-> () const |
| Access to fields.
|
|
constexpr SDL_Condition * | operator-> () |
| Access to fields.
|
|
Condition variables, paired with an MutexBase, 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
- Since
- This struct is available since SDL 3.2.0.
- Category:
- Resource
- See also
- Condition
-
ConditionRef