P99
|
Modules | |
Atomic_types | |
Macros | |
#define | P99_DECLARE_ATOMIC(...) |
#define | P99_FIFO(T) P99_PASTE2(p00_fifo_, T) |
#define | P99_FIFO_APPEND(L, EL) |
Append element EL to an atomic FIFO L. More... | |
#define | P99_FIFO_CLEAR(L) |
Atomically clear an atomic FIFO L and return a pointer to the start of the list that it previously contained. More... | |
#define | P99_FIFO_DECLARE(T) |
#define | P99_FIFO_INITIALIZER(HEAD, TAIL) |
#define | P99_FIFO_POP(L) |
Pop the front element from an atomic FIFO L. More... | |
#define | P99_FIFO_TABULATE(TYPE, TAB, L) P00_FIFO_TABULATE(TYPE, TAB, P99_UNIQ(TAB), L) |
#define | P99_LIFO(T) P99_TP(T) |
#define | P99_LIFO_CLEAR(L) |
Atomically clear an atomic LIFO L and return a pointer to the start of the list that it previously contained. More... | |
#define | P99_LIFO_DECLARE(T) P99_TP_DECLARE(T) |
#define | p99_lifo_init(EL, VAL) p99_tp_init((EL), (VAL)) |
#define | P99_LIFO_INITIALIZER(VAL) P99_TP_INITIALIZER(VAL) |
#define | P99_LIFO_POP(L) |
Pop the top element from an atomic LIFO L. More... | |
#define | P99_LIFO_PUSH(L, EL) |
Push element EL into an atomic LIFO L. More... | |
#define | P99_LIFO_TABULATE(TYPE, TAB, L) P00_LIFO_TABULATE(TYPE, TAB, P99_UNIQ(TAB), L) |
#define | P99_LIFO_TOP(L) P99_TP_GET(L) |
Return a pointer to the top element of an atomic LIFO L. More... | |
Typedefs | |
typedef struct atomic_double | double |
typedef struct atomic_float | float |
This is a stub implementation of C11 atomic types and operations.
This uses gcc extensions
typeof
to declare typedef
or local variables of a specific type({ ... })
We also use __sync_lock_test_and_set
and other similar built-ins if they are available. If not, __sync_lock_test_and_set
and __sync_lock_release
are implemented in assembler (for 4 byte integers) and all other operations are synthesized with an ::atomic_flag that is used as a spinlock.