Go to the documentation of this file.
21 #ifndef P99_NOTIFIER_H
22 #define P99_NOTIFIER_H
92 #define p99_notifier_init(...) P99_CALL_DEFARG(p99_notifier_init, 2, __VA_ARGS__)
93 #define p99_notifier_init_defarg_1() 0U
128 #define p99_notifier_block(...) P99_CALL_DEFARG(p99_notifier_block, 2, __VA_ARGS__)
129 #define p99_notifier_block_defarg_1() 1U
135 # define P99_NOTIFIER_INITIALIZER P99_FUTEX_INITIALIZER(0u)
155 void p99_notifier_set(
p99_notifier volatile* p00_n,
unsigned p00_v) {
181 #define p99_notifier_set(...) P99_CALL_DEFARG(p99_notifier_set, 2, __VA_ARGS__)
182 #define p99_notifier_set_defarg_1() 1U
void p99_futex_destroy(p99_futex *p00_c)
Destroy an p99_futex object.
A counter similar to a conditional variable that allows atomic increment and decrement and to wait fo...
void p99_notifier_block(p99_notifier volatile *p00_n, unsigned p00_v)
Block until the notification flag has been set to the indicated value.
p99_notifier * p99_notifier_init(p99_notifier *p00_n, unsigned p00_v)
Initialize a notifier to value p00_v.
#define P99_SETJMP_INLINE(NAME)
unsigned p99_futex_exchange(p99_futex volatile *p00_fut, unsigned p00_desired, unsigned p00_cstart, unsigned p00_clen, unsigned p00_wmin, unsigned p00_wmax)
Unconditionally and atomically set the futex p00_fut to value p00_desired.
#define p99_inline
Try to force a function always to be inlined.
#define P99_FUTEX_COMPARE_EXCHANGE(FUTEX, ACT, EXPECTED, DESIRED, WAKEMIN, WAKEMAX)
a catch all macro to operate on p99_futex
Set a flag and notify other threads that an event has occurred.
#define P99_DEFARG_DOCU(NAME)
Provide a documentation section to a function defined with P99_CALL_DEFARG.
unsigned p99_futex_load(p99_futex volatile *p00_fut)
Obtain the value of futex p00_fut atomically.
void p99_notifier_destroy(p99_notifier *p00_n)
destroy a notifier
unsigned p99_notifier_load(p99_notifier volatile *p00_n)
Return the value of the notifier. Non blocking.
#define P99_FUTEX_MAX_WAITERS
the maximum number of waiters that an p99_futex may have
p99_futex * p99_futex_init(p99_futex *p00_c, unsigned p00_ini)
Initialize an p99_futex object.