Reference

<atomic>

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_relaxed RelaxedThe call has no effects.
memory_order_consume ConsumeSets up an acquire signal fence:
Orders instructions with respect to the last release or sequentially consistent operation in the same thread.
memory_order_acquire Acquire
memory_order_release ReleaseSets up a release signal fence:
Orders instructions with respect to the next acquire operation in the same thread.
memory_order_acq_rel Acquire/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_cst Sequentially 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

atomic_thread_fence
Thread fence (function)

AltStyle によって変換されたページ (->オリジナル) /