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

Method store

Libraries/Threading/Atomic.cpp:167–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165}
166
167void Atomic<int32_t>::store(int32_t desired, memory_order mem)
168{
169#if _MSC_VER
170 if (mem == memory_order_seq_cst)
171 {
172 (void)_InterlockedExchange(reinterpret_cast<volatile long*>(&value), desired);
173 }
174 else
175 {
176 SC_COMPILER_MSVC_ATOMIC_STORE_VERIFY_MEMORY_ORDER(mem);
177 __iso_volatile_store32(reinterpret_cast<volatile int*>(&value), desired);
178 }
179#else
180 __atomic_store_n(&value, desired, mem);
181#endif
182}
183
184int32_t Atomic<int32_t>::exchange(int32_t desired, memory_order mem)
185{

Calls

no outgoing calls