MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / msvc_select_cas_order

Function msvc_select_cas_order

Libraries/Threading/Atomic.cpp:87–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85#if _MSC_VER
86
87memory_order msvc_select_cas_order(memory_order success, memory_order failure)
88{
89 // Promote to acq_rel if release success is combined with acquire/consume failure.
90 if (success == memory_order_release && (failure == memory_order_acquire || failure == memory_order_consume))
91 {
92 return memory_order_acq_rel;
93 }
94 // Otherwise, the success order is sufficient, because for all other cases
95 // the load part of the RMW is at least as strong as the failure load.
96 // (e.g. acquire, acq_rel, seq_cst success imply an acquire load).
97 return success;
98}
99
100#endif
101

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected