function
<atomic>

atomic_signal_fence

extern "C" void atomic_signal_fence (memory_order sync) noexcept;
Signal fence
Establishes a single-thread fence: The point of call to this function becomes either an acquire or a release ordering point (or both) within a single thread.

This function is equivalent to atomic_thread_fence except that no inter-thread synchronization happens because of the call. The function operates as a directive to the compiler inhibiting it from making optimizations that involve moving writing operations beyond a releasing fence or read operations before an acquire fence.

Parameters

sync
Synchronization mode for the operation.
This shall be one of these possible values of the enum type memory_order:
valuememory orderdescription
memory_order_relaxedRelaxedThe call has no effects.
memory_order_consumeConsumeSets up an acquire signal fence:
Orders instructions with respect to the last release or sequentially consistent operation in the same thread.
memory_order_acquireAcquire
memory_order_releaseReleaseSets up a release signal fence:
Orders instructions with respect to the next acquire operation in the same thread.
memory_order_acq_relAcquire/ReleaseSets up a signal fence that is both an acquire fence and a release fence:
All instructions are ordered with respect to the last release or sequentially consistent operation and with the next acquire operation in the same thread.
memory_order_seq_cstSequentially consistentSets up a sequentially consistent acquire and release signal fence:
All instructions are ordered with respect to the other sequentially consistent operations in the same thread.

Return value

none

Data races

No data races are initiated by calling this function.

Exception safety

No-throw guarantee: never throws exceptions.

See also