View source code
Display the source code in core/stdc/stdatomic.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

Module core.stdc.stdatomic

A D implementation of the C stdatomic.h header.

Note: 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.

Note: The D shared type qualifier is the closest to the Atomic type qualifier from C. It may be changed from shared in the future.

Note: Fail memory order is currently ignored due to limitations with internal implementation of atomics.

Functions

NameDescription
atomic_compare_exchange_strong_explicit_impl(obj, expected, desired, succ, fail)
atomic_compare_exchange_strong_impl(obj, expected, desired)
atomic_compare_exchange_weak_explicit_impl(obj, expected, desired, succ, fail)
atomic_compare_exchange_weak_impl(obj, expected, desired)
atomic_exchange_explicit_impl(obj, desired, order)
atomic_exchange_impl(obj, desired)
atomic_fetch_add_explicit_impl(obj, arg, order)
atomic_fetch_add_impl(obj, arg)
atomic_fetch_and_explicit_impl(obj, arg, order)
atomic_fetch_and_impl(obj, arg)
atomic_fetch_or_explicit_impl(obj, arg, order)
atomic_fetch_or_impl(obj, arg)
atomic_fetch_sub_explicit_impl(obj, arg, order)
atomic_fetch_xor_explicit_impl(obj, arg, order)
atomic_fetch_xor_impl(obj, arg)
atomic_flag_clear_explicit_impl(obj, order)
atomic_flag_clear_impl(obj)
atomic_flag_test_and_set_explicit_impl(obj, order)
atomic_flag_test_and_set_impl(obj)
atomic_init(obj, desired) Initializes an atomic variable, the destination should not have any expression associated with it prior to this call.
atomic_is_lock_free(obj)
atomic_load_explicit_impl(obj, order)
atomic_load_impl(obj)
atomic_signal_fence_impl(order) Don't allow reordering, does not emit any instructions.
atomic_store_explicit_impl(obj, desired, order)
atomic_store_impl(obj, desired)
atomic_thread_fence_impl(order) Don't allow reordering, and emit a fence instruction.
kill_dependency(y) No-op function, doesn't apply to D

Structs

NameDescription
atomic_flag Guaranteed to be a atomic boolean type

Enums

NameDescription
memory_order

Manifest constants

NameTypeDescription
ATOMIC_BOOL_LOCK_FREE
ATOMIC_CHAR16_T_LOCK_FREE
ATOMIC_CHAR32_T_LOCK_FREE
ATOMIC_CHAR8_T_LOCK_FREE
ATOMIC_CHAR_LOCK_FREE
ATOMIC_FLAG_INIT
ATOMIC_INT_LOCK_FREE
ATOMIC_LLONG_LOCK_FREE
ATOMIC_LONG_LOCK_FREE
ATOMIC_POINTER_LOCK_FREE
ATOMIC_SHORT_LOCK_FREE
ATOMIC_WCHAR_T_LOCK_FREE

Aliases

NameTypeDescription
atomic_bool shared(bool)
atomic_char shared(char)
atomic_char16_t shared(wchar)
atomic_char32_t shared(dchar)
atomic_char8_t shared(char)
atomic_int shared(int)
atomic_int_fast16_t shared(long)
atomic_int_fast32_t shared(long)
atomic_int_fast64_t shared(long)
atomic_int_fast8_t shared(byte)
atomic_int_least16_t shared(short)
atomic_int_least32_t shared(int)
atomic_int_least64_t shared(long)
atomic_int_least8_t shared(byte)
atomic_intmax_t shared(long)
atomic_intptr_t shared(long)
atomic_llong shared(long)
atomic_long shared(long)
atomic_ptrdiff_t shared(long)
atomic_schar shared(byte)
atomic_short shared(short)
atomic_signal_fence atomic_signal_fence_impl
atomic_size_t shared(ulong)
atomic_uchar shared(ubyte)
atomic_uint shared(uint)
atomic_uint_fast16_t shared(ulong)
atomic_uint_fast32_t shared(ulong)
atomic_uint_fast64_t shared(ulong)
atomic_uint_fast8_t shared(ubyte)
atomic_uint_least16_t shared(ushort)
atomic_uint_least32_t shared(uint)
atomic_uint_least64_t shared(ulong)
atomic_uint_least8_t shared(ubyte)
atomic_uintmax_t shared(ulong)
atomic_uintptr_t shared(ulong)
atomic_ullong shared(ulong)
atomic_ulong shared(ulong)
atomic_ushort shared(ushort)
atomic_wchar_t shared(wchar)

Authors

Richard (Rikki) Andrew cattermole

License

Boost License 1.0