Zen API

- Home
- Topics
- Types
- Files

All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kAtomic.h
Go to the documentation of this file.
1
10 #include <kApi/kApiDef.h> //--inclusion order controlled by kApiDef
11
12 #ifndef K_API_ATOMIC_H
13 #define K_API_ATOMIC_H
14
15 kBeginHeader()
16
17
18
25 //typedef kxAtomic32s kAtomic32s; // --forward-declared in kApiDef.x.h
26
27
36 kFx(k32s) kAtomic32s_Increment(kAtomic32s* atomic);
37
47 kFx(k32s) kAtomic32s_Decrement(kAtomic32s* atomic);
48
59 kFx(k32s) kAtomic32s_Exchange(kAtomic32s* atomic, k32s value);
60
74 kFx(kBool) kAtomic32s_CompareExchange(kAtomic32s* atomic, k32s oldValue, k32s value);
75
85 kFx(k32s) kAtomic32s_Get(kAtomic32s* atomic);
86
87
90 #define kAtomic32s_Init_(ATM, VAL) kxAtomic32s_Init_(ATM, VAL)
91 #define kAtomic32s_Increment_(ATM) kxAtomic32s_Increment_(ATM)
92 #define kAtomic32s_Decrement_(ATM) kxAtomic32s_Decrement_(ATM)
93 #define kAtomic32s_Exchange_(ATM, VAL) kxAtomic32s_Exchange_(ATM, VAL)
94 #define kAtomic32s_CompareExchange_(ATM, OLD, VAL) kxAtomic32s_CompareExchange_(ATM, OLD, VAL)
95 #define kAtomic32s_Get_(ATM) kxAtomic32s_Get_(ATM)
96
97
107 //typedef kxAtomicPointer kAtomicPointer; // --forward-declared in kApiDef.x.h
108
109
120 kFx(kPointer) kAtomicPointer_Exchange(kAtomicPointer* atomic, kPointer value);
121
135 kFx(kBool) kAtomicPointer_CompareExchange(kAtomicPointer* atomic, kPointer oldValue, kPointer value);
136
146 kFx(kPointer) kAtomicPointer_Get(kAtomicPointer* atomic);
147
150 #define kAtomicPointer_Init_(ATM, VAL) kxAtomicPointer_Init_(ATM, VAL)
151 #define kAtomicPointer_Exchange_(ATM, VAL) kxAtomicPointer_Exchange_(ATM, VAL)
152 #define kAtomicPointer_CompareExchange_(ATM, OLD, VAL) kxAtomicPointer_CompareExchange_(ATM, OLD, VAL)
153 #define kAtomicPointer_Get_(ATM) kxAtomicPointer_Get_(ATM)
154
155
157 kEndHeader()
158
159 #include <kApi/Threads/kAtomic.x.h>
160
161 #endif
kPointer
Represents a void pointer.
kAtomic32s::kAtomic32s_Increment
k32s kAtomic32s_Increment(kAtomic32s *atomic)
Increments an atomic variable.
kAtomic32s::kAtomic32s_CompareExchange
kBool kAtomic32s_CompareExchange(kAtomic32s *atomic, k32s oldValue, k32s value)
Conditionally exchanges the value of an atomic variable.
kAtomicPointer::kAtomicPointer_CompareExchange
kBool kAtomicPointer_CompareExchange(kAtomicPointer *atomic, kPointer oldValue, kPointer value)
Conditionally exchanges the value of an atomic variable.
kAtomic32s
Represents a 32-bit, atomically-accessed, signed integer.
kApiDef.h
Core Zen type declarations.
k32s
Represents a 32-bit signed integer.
kAtomic32s::kAtomic32s_Decrement
k32s kAtomic32s_Decrement(kAtomic32s *atomic)
Decrements an atomic variable.
kAtomicPointer
Represents an atomically-accessed pointer.
kBool
Represents a boolean value.
kAtomic32s::kAtomic32s_Exchange
k32s kAtomic32s_Exchange(kAtomic32s *atomic, k32s value)
Exchanges the value of an atomic variable.
kAtomicPointer::kAtomicPointer_Exchange
kPointer kAtomicPointer_Exchange(kAtomicPointer *atomic, kPointer value)
Exchanges the value of an atomic variable.
kAtomic32s::kAtomic32s_Get
k32s kAtomic32s_Get(kAtomic32s *atomic)
Gets the current value of an atomic variable.
kAtomicPointer::kAtomicPointer_Get
kPointer kAtomicPointer_Get(kAtomicPointer *atomic)
Gets the current value of an atomic variable.