P99
Modules | Macros | Typedefs
+ Collaboration diagram for C11 atomic operations:

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
 

Detailed Description

This is a stub implementation of C11 atomic types and operations.

This uses gcc extensions

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.

See also
_Atomic
P99_DECLARE_ATOMIC
P99_MACRO_VAR
#define P99_MACRO_VAR(NAME, EXPR, QUAL)
Define a variable with NAME that has the type and value of EXPR.
Definition: p99_for.h:1268
P99_LIFO_PUSH
#define P99_LIFO_PUSH(L, EL)
Push element EL into an atomic LIFO L.
Definition: p99_lifo.h:68
P99_FIFO_POP
#define P99_FIFO_POP(L)
Pop the front element from an atomic FIFO L.
Definition: p99_fifo.h:136
P99_FIFO_APPEND
#define P99_FIFO_APPEND(L, EL)
Append element EL to an atomic FIFO L.
Definition: p99_fifo.h:61
P99_TP_STATE_GET
#define P99_TP_STATE_GET(TPS)
P99_FIFO
#define P99_FIFO(T)
Definition: p99_fifo.h:39
p99_extension
#define p99_extension
Mark an expression as using a compiler extension.
Definition: p99_compiler.h:210
P99_NEW
#define P99_NEW(...)
Allocate an element of type T as given by the first argument and initialize it with the remaining arg...
Definition: p99_new.h:314
P99_PASTE2
#define P99_PASTE2(_1, _2)
Paste two token sequences at their junction.
Definition: p99_paste.h:82
P99_TP_STATE_INITIALIZER
#define P99_TP_STATE_INITIALIZER(TP, P)
P99_NARG
#define P99_NARG(...)
Return the length of the variable length argument list, where an empty argument list is considered to...
Definition: p99_args.h:117
P99_DECLARE_STRUCT
#define P99_DECLARE_STRUCT(NAME)
forward declaration of a struct NAME
Definition: p99_type.h:59
P99_POINTER_TYPE
#define P99_POINTER_TYPE(T)
Declare derived pointer types with endings "_ptr" and "_cptr".
Definition: p99_type.h:132
P99_LIFO
#define P99_LIFO(T)
Definition: p99_lifo.h:42
P99_LIFO_POP
#define P99_LIFO_POP(L)
Pop the top element from an atomic LIFO L.
Definition: p99_lifo.h:120
P99_FIFO_DECLARE
#define P99_FIFO_DECLARE(T)
Definition: p99_fifo.h:40
P99_TP_TYPE
#define P99_TP_TYPE(TP)
P99_TP_STATE_COMMIT
#define P99_TP_STATE_COMMIT(TPS)