ovs-atomic-pthreads: Use global shared locks for atomic_flag also.
[sliver-openvswitch.git] / lib / ovs-atomic-types.h
1 /* This header defines atomic_* types using an ATOMIC macro provided by the
2 * caller. */
3 #ifndef IN_OVS_ATOMIC_H
4 #error "This header should only be included indirectly via ovs-atomic.h."
5 #endif
6
7 #ifndef OMIT_STANDARD_ATOMIC_TYPES
8 typedef ATOMIC(bool)               atomic_bool;
9
10 typedef ATOMIC(char)               atomic_char;
11 typedef ATOMIC(signed char)        atomic_schar;
12 typedef ATOMIC(unsigned char)      atomic_uchar;
13
14 typedef ATOMIC(short)              atomic_short;
15 typedef ATOMIC(unsigned short)     atomic_ushort;
16
17 typedef ATOMIC(int)                atomic_int;
18 typedef ATOMIC(unsigned int)       atomic_uint;
19
20 typedef ATOMIC(long)               atomic_long;
21 typedef ATOMIC(unsigned long)      atomic_ulong;
22
23 typedef ATOMIC(long long)          atomic_llong;
24 typedef ATOMIC(unsigned long long) atomic_ullong;
25
26 typedef ATOMIC(size_t)             atomic_size_t;
27 typedef ATOMIC(ptrdiff_t)          atomic_ptrdiff_t;
28
29 typedef ATOMIC(intmax_t)           atomic_intmax_t;
30 typedef ATOMIC(uintmax_t)          atomic_uintmax_t;
31
32 typedef ATOMIC(intptr_t)           atomic_intptr_t;
33 typedef ATOMIC(uintptr_t)          atomic_uintptr_t;
34 #endif  /* !OMIT_STANDARD_ATOMIC_TYPES */
35
36 /* Nonstandard atomic types. */
37 typedef ATOMIC(uint8_t)   atomic_uint8_t;
38 typedef ATOMIC(uint16_t)  atomic_uint16_t;
39 typedef ATOMIC(uint32_t)  atomic_uint32_t;
40 typedef ATOMIC(uint64_t)  atomic_uint64_t;
41
42 typedef ATOMIC(int8_t)    atomic_int8_t;
43 typedef ATOMIC(int16_t)   atomic_int16_t;
44 typedef ATOMIC(int32_t)   atomic_int32_t;
45 typedef ATOMIC(int64_t)   atomic_int64_t;
46
47 #undef OMIT_STANDARD_ATOMIC_TYPES