Skip to content

Commit e2135d5

Browse files
committed
shims: add a definition for os_atomic_init
This is adopted from osfmk to provide the `os_atomic_init` macro which still relies on the C11 atomics.
1 parent da96c6d commit e2135d5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/shims/atomic.h

+2
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ typedef struct { unsigned long __opaque_zero; } os_atomic_dependency_t;
143143

144144
#define os_atomic_thread_fence(m) atomic_thread_fence(memory_order_##m)
145145

146+
#define os_atomic_init(p, v) atomic_init(_os_atomic_c11_atomic(p), v)
147+
146148
#define os_atomic_inc(p, m) \
147149
os_atomic_add((p), 1, m)
148150
#define os_atomic_inc_orig(p, m) \

0 commit comments

Comments
 (0)