Skip to content

Commit

Permalink
Fix microsoft#739 (without saving stack variable)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexGuteniev committed Apr 23, 2020
1 parent 0cbd1b2 commit ad3adbd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stl/inc/atomic
Original file line number Diff line number Diff line change
Expand Up @@ -1942,8 +1942,8 @@ extern "C" inline void atomic_thread_fence(const memory_order _Order) noexcept {
#else // ^^^ ARM32/ARM64 hardware / x86/x64 hardware vvv
_Compiler_barrier();
if (_Order == memory_order_seq_cst) {
static long _Guard;
(void) _InterlockedCompareExchange(&_Guard, 0, 0);
volatile long _Guard;
(void) _InterlockedExchange(&_Guard, 0);
_Compiler_barrier();
}
#endif // hardware
Expand Down

0 comments on commit ad3adbd

Please sign in to comment.