libtransistor
A userland library for the Nintendo Switch
|
Condition variables. More...
Go to the source code of this file.
Data Structures | |
struct | trn_condvar_t |
Macros | |
#define | TRN_CONDVAR_STATIC_INITIALIZER {.key = 0} |
Functions | |
void | trn_condvar_create (trn_condvar_t *condvar) |
Creates a condition variable. More... | |
result_t | trn_condvar_signal (trn_condvar_t *condvar, int n) |
Signals n threads waiting on the condition variable, or -1 for all of them. | |
result_t | trn_condvar_wait (trn_condvar_t *condvar, trn_mutex_t *mutex, uint64_t timeout) REQUIRES(mutex) |
Waits for the condition variable to be signalled. More... | |
void | trn_condvar_destroy (trn_condvar_t *condvar) |
Destroys a condition variable. | |
Condition variables.
void trn_condvar_create | ( | trn_condvar_t * | condvar | ) |
Creates a condition variable.
Alternatively, a statically allocated condition variable may be initialized with /ref TRN_CONDVAR_STATIC_INITIALIZER
result_t trn_condvar_wait | ( | trn_condvar_t * | condvar, |
trn_mutex_t * | mutex, | ||
uint64_t | timeout | ||
) |
Waits for the condition variable to be signalled.
timeout | How long (in nanoseconds) to wait, or -1 for no timeout |