SDL3pp
A slim C++ wrapper for SDL3
|
SDL offers several thread synchronization primitives. More...
Classes | |
struct | SDL::MutexRef |
A means to serialize access to a resource between threads. More... | |
struct | SDL::Mutex |
Handle to an owned mutex. More... | |
struct | SDL::MutexUnsafe |
Unsafe Handle to mutex. More... | |
struct | SDL::RWLockRef |
A mutex that allows read-only threads to run in parallel. More... | |
struct | SDL::RWLock |
Handle to an owned rWLock. More... | |
struct | SDL::RWLockUnsafe |
Unsafe Handle to rWLock. More... | |
struct | SDL::SemaphoreRef |
A means to manage access to a resource, by count, between threads. More... | |
struct | SDL::Semaphore |
Handle to an owned semaphore. More... | |
struct | SDL::SemaphoreUnsafe |
Unsafe Handle to semaphore. More... | |
struct | SDL::ConditionRef |
A means to block multiple threads until a condition is satisfied. More... | |
struct | SDL::Condition |
Handle to an owned condition. More... | |
struct | SDL::ConditionUnsafe |
Unsafe Handle to condition. More... | |
struct | SDL::InitState |
A structure used for thread-safe initialization and shutdown. More... | |
Typedefs | |
using | SDL::MutexShared = ResourceShared< Mutex > |
Handle to a shared mutex. | |
using | SDL::MutexWeak = ResourceWeak< Mutex > |
Weak handle to a shared mutex. | |
using | SDL::RWLockShared = ResourceShared< RWLock > |
Handle to a shared rWLock. | |
using | SDL::RWLockWeak = ResourceWeak< RWLock > |
Weak handle to a shared rWLock. | |
using | SDL::SemaphoreShared = ResourceShared< Semaphore > |
Handle to a shared semaphore. | |
using | SDL::SemaphoreWeak = ResourceWeak< Semaphore > |
Weak handle to a shared semaphore. | |
using | SDL::ConditionShared = ResourceShared< Condition > |
Handle to a shared condition. | |
using | SDL::ConditionWeak = ResourceWeak< Condition > |
Weak handle to a shared condition. | |
using | SDL::InitStatus = SDL_InitStatus |
The current status of an InitState structure. | |
Functions | |
MutexShared | SDL::Mutex::share () |
Move this mutex into a MutexShared. | |
RWLockShared | SDL::RWLock::share () |
Move this rWLock into a RWLockShared. | |
SemaphoreShared | SDL::Semaphore::share () |
Move this semaphore into a SemaphoreShared. | |
ConditionShared | SDL::Condition::share () |
Move this condition into a ConditionShared. | |
Variables | |
constexpr InitStatus | SDL::INIT_STATUS_UNINITIALIZED |
INIT_STATUS_UNINITIALIZED. | |
constexpr InitStatus | SDL::INIT_STATUS_INITIALIZING |
INIT_STATUS_INITIALIZING. | |
constexpr InitStatus | SDL::INIT_STATUS_INITIALIZED |
INIT_STATUS_INITIALIZED. | |
constexpr InitStatus | SDL::INIT_STATUS_UNINITIALIZING |
INIT_STATUS_UNINITIALIZING. | |
This document can't cover the complicated topic of thread safety, but reading up on what each of these primitives are, why they are useful, and how to correctly use them is vital to writing correct and safe multithreaded programs.
SDL also offers a datatype, InitState, which can be used to make sure only one thread initializes/deinitializes some resource that several threads might try to use for the first time simultaneously.
using SDL::ConditionShared = typedef ResourceShared<Condition> |
using SDL::ConditionWeak = typedef ResourceWeak<Condition> |
using SDL::InitStatus = typedef SDL_InitStatus |
using SDL::MutexShared = typedef ResourceShared<Mutex> |
using SDL::MutexWeak = typedef ResourceWeak<Mutex> |
using SDL::RWLockShared = typedef ResourceShared<RWLock> |
using SDL::RWLockWeak = typedef ResourceWeak<RWLock> |
using SDL::SemaphoreShared = typedef ResourceShared<Semaphore> |
using SDL::SemaphoreWeak = typedef ResourceWeak<Semaphore> |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |