Go to the documentation of this file.
50 # define P99_COUNT_INITIALIZER P99_FUTEX_INITIALIZER
61 #define p99_count_init(...) P99_CALL_DEFARG(p99_count_init, 2, __VA_ARGS__)
62 #define p99_count_init_defarg_1() 0U
74 #define P99_ACCOUNT(COUNT) \
75 P00_BLK_DECL(p99_count*, p00Mcount, &(COUNT)) \
76 P99_PROTECTED_BLOCK(p99_count_inc(p00Mcount), p99_count_dec(p00Mcount))
89 #define p99_count_inc(...) P99_CALL_DEFARG(p99_count_inc, 2, __VA_ARGS__)
90 #define p99_count_inc_defarg_1() (1U)
101 unsigned p00_ret = 0;
106 (!p00_act ? 0U : p00_act + p00_hm),
109 ((p00_ret = p00_act), 0), 0);
113 #define p99_count_inc_conditionally(...) P99_CALL_DEFARG(p99_count_inc_conditionally, 2, __VA_ARGS__)
114 #define p99_count_inc_conditionally_defarg_1() (1U)
140 #define p99_count_dec(...) P99_CALL_DEFARG(p99_count_dec, 2, __VA_ARGS__)
141 #define p99_count_dec_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...
#define P99_BLOCK_DOCUMENT
Add some default documentation and links to the following block macro.
void p99_count_wait(p99_count volatile *p00_c)
wait until the p00_c counter falls to 0.
#define p99_count_init(...)
#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
#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.
#define p99_count_inc_conditionally(...)
increment the counter p00_c atomically by p00_hm but only if it is not zero before.
unsigned p99_count_value(p99_count volatile *p00_c)
Obtain the value of counter p00_c atomically.
unsigned p99_futex_add(p99_futex volatile *p00_fut, unsigned p00_hmuch, unsigned p00_cstart, unsigned p00_clen, unsigned p00_wmin, unsigned p00_wmax)
increment the counter of p00_fut atomically by p00_hmuch.
A counter that allows atomic increment and decrement and a wait for the value 0.
#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.
void p99_count_destroy(p99_count *p00_c)
#define p99_count_dec(...)
decrement the counter p00_c atomically by p00_hm.
#define p99_count_inc(...)
increment the counter counter atomically by p00_hm.