The OpenD Programming Language

core.stdc.stdatomic

A D implementation of the C stdatomic.h header.

If it compiles it should produce similar assembly to the system C toolchain and should not introduce when optimizing unnecessary behaviors, if you do not care about this guarantee use the _impl suffix.
The D shared type qualifier is the closest to the Atomic type qualifier from C. It may be changed from shared in the future.

Members

Aliases

atomic_bool
alias atomic_bool = shared(bool)
atomic_char
alias atomic_char = shared(char)
atomic_char16_t
alias atomic_char16_t = shared(wchar)
atomic_char32_t
alias atomic_char32_t = shared(dchar)
atomic_char8_t
alias atomic_char8_t = shared(char)
atomic_int
alias atomic_int = shared(int)
atomic_int_fast16_t
alias atomic_int_fast16_t = shared(int_fast16_t)
atomic_int_fast32_t
alias atomic_int_fast32_t = shared(int_fast32_t)
atomic_int_fast64_t
alias atomic_int_fast64_t = shared(int_fast64_t)
atomic_int_fast8_t
alias atomic_int_fast8_t = shared(int_fast8_t)
atomic_int_least16_t
alias atomic_int_least16_t = shared(int_least16_t)
atomic_int_least32_t
alias atomic_int_least32_t = shared(int_least32_t)
atomic_int_least64_t
alias atomic_int_least64_t = shared(int_least64_t)
atomic_int_least8_t
alias atomic_int_least8_t = shared(int_least8_t)
atomic_intmax_t
alias atomic_intmax_t = shared(intmax_t)
atomic_intptr_t
alias atomic_intptr_t = shared(intptr_t)
atomic_llong
alias atomic_llong = shared(long)
atomic_long
alias atomic_long = shared(c_long)
atomic_ptrdiff_t
alias atomic_ptrdiff_t = shared(ptrdiff_t)
atomic_schar
alias atomic_schar = shared(byte)
atomic_short
alias atomic_short = shared(short)
atomic_size_t
alias atomic_size_t = shared(size_t)
atomic_uchar
alias atomic_uchar = shared(ubyte)
atomic_uint
alias atomic_uint = shared(uint)
atomic_uint_fast16_t
alias atomic_uint_fast16_t = shared(uint_fast16_t)
atomic_uint_fast32_t
alias atomic_uint_fast32_t = shared(uint_fast32_t)
atomic_uint_fast64_t
alias atomic_uint_fast64_t = shared(uint_fast64_t)
atomic_uint_fast8_t
alias atomic_uint_fast8_t = shared(uint_fast8_t)
atomic_uint_least16_t
alias atomic_uint_least16_t = shared(uint_least16_t)
atomic_uint_least32_t
alias atomic_uint_least32_t = shared(uint_least32_t)
atomic_uint_least64_t
alias atomic_uint_least64_t = shared(uint_least64_t)
atomic_uint_least8_t
alias atomic_uint_least8_t = shared(uint_least8_t)
atomic_uintmax_t
alias atomic_uintmax_t = shared(uintmax_t)
atomic_uintptr_t
alias atomic_uintptr_t = shared(uintptr_t)
atomic_ullong
alias atomic_ullong = shared(ulong)
atomic_ulong
alias atomic_ulong = shared(c_ulong)
atomic_ushort
alias atomic_ushort = shared(ushort)
atomic_wchar_t
alias atomic_wchar_t = shared(wchar)

Enums

__STDC_VERSION_STDATOMIC_H__
anonymousenum __STDC_VERSION_STDATOMIC_H__

Functions

atomic_compare_exchange_strong_explicit_impl
bool atomic_compare_exchange_strong_explicit_impl(shared(A)* obj, A* expected, C desired, memory_order succ, memory_order fail)
atomic_compare_exchange_strong_impl
bool atomic_compare_exchange_strong_impl(shared(A)* obj, A* expected, C desired)
atomic_compare_exchange_weak_explicit_impl
bool atomic_compare_exchange_weak_explicit_impl(shared(A)* obj, A* expected, C desired, memory_order succ, memory_order fail)
atomic_compare_exchange_weak_impl
bool atomic_compare_exchange_weak_impl(shared(A)* obj, A* expected, C desired)
atomic_exchange_explicit_impl
A atomic_exchange_explicit_impl(shared(A)* obj, C desired, memory_order order)
atomic_exchange_impl
A atomic_exchange_impl(shared(A)* obj, C desired)
atomic_fetch_add_explicit_impl
A atomic_fetch_add_explicit_impl(shared(A)* obj, M arg, memory_order order)
atomic_fetch_add_impl
A atomic_fetch_add_impl(shared(A)* obj, M arg)
atomic_fetch_and_explicit_impl
A atomic_fetch_and_explicit_impl(shared(A)* obj, M arg, memory_order order)
atomic_fetch_and_impl
A atomic_fetch_and_impl(shared(A)* obj, M arg)
atomic_fetch_or_explicit_impl
A atomic_fetch_or_explicit_impl(shared(A)* obj, M arg, memory_order order)
atomic_fetch_or_impl
A atomic_fetch_or_impl(shared(A)* obj, M arg)
atomic_fetch_sub_explicit_impl
A atomic_fetch_sub_explicit_impl(shared(A)* obj, M arg, memory_order order)
atomic_fetch_xor_explicit_impl
A atomic_fetch_xor_explicit_impl(shared(A)* obj, M arg, memory_order order)
atomic_fetch_xor_impl
A atomic_fetch_xor_impl(shared(A)* obj, M arg)
atomic_flag_clear_explicit_impl
void atomic_flag_clear_explicit_impl(atomic_flag* obj, memory_order order)
atomic_flag_clear_impl
void atomic_flag_clear_impl(atomic_flag* obj)
atomic_flag_test_and_set_explicit_impl
bool atomic_flag_test_and_set_explicit_impl(atomic_flag* obj, memory_order order)
atomic_flag_test_and_set_impl
bool atomic_flag_test_and_set_impl(atomic_flag* obj)
atomic_init
void atomic_init(shared(A) obj, C desired)

Initializes an atomic variable, the destination should not have any expression associated with it prior to this call.

atomic_is_lock_free
bool atomic_is_lock_free(shared(A)* obj)
atomic_load_explicit_impl
A atomic_load_explicit_impl(shared(A)* obj, memory_order order)
atomic_load_impl
A atomic_load_impl(shared(A)* obj)
atomic_signal_fence_impl
void atomic_signal_fence_impl(memory_order order)

Don't allow reordering, does not emit any instructions.

atomic_store_explicit_impl
void atomic_store_explicit_impl(shared(A)* obj, C desired, memory_order order)
atomic_store_impl
void atomic_store_impl(shared(A)* obj, C desired)
atomic_thread_fence_impl
void atomic_thread_fence_impl(memory_order order)

Don't allow reordering, and emit a fence instruction.

kill_dependency
A kill_dependency(A y)

No-op function, doesn't apply to D

Manifest constants

ATOMIC_FLAG_INIT
enum ATOMIC_FLAG_INIT;

Structs

atomic_flag
struct atomic_flag

Guaranteed to be a atomic boolean type

Meta

Authors

Richard (Rikki) Andrew cattermole