extern "C" void atomic_thread_fence (memory_order sync) noexcept;
enum
类型的一个可能值。值 | memory order | 描述 |
---|---|---|
memory_order_relaxed | Relaxed | 调用没有效果。 |
memory_order_consume | Consume | 设置一个acquire fence 同步上一个release或sequentially consistent操作的所有可见副作用。 |
memory_order_acquire | Acquire | |
memory_order_release | Release | 设置一个release fence 将副作用与下一个acquire操作同步。 |
memory_order_acq_rel | Acquire/Release | 设置一个同时是acquire fence和release fence的栅栏。 同步上一个release或sequentially consistent操作的所有可见副作用,并与下一个acquire操作同步。 |
memory_order_seq_cst | Sequentially consistent | 设置一个sequentially consistent acquire and release fence。 将所有可见的副作用与其他的sequentially consistent操作同步,遵循一个单一的总顺序。 |