diff options
author | Mitya Selivanov <0x7fffff@guattari.ru> | 2022-08-15 02:25:43 +0400 |
---|---|---|
committer | Mitya Selivanov <0x7fffff@guattari.ru> | 2022-08-15 02:25:43 +0400 |
commit | b0811b24d400aaab3629440c0da9fd792b22f55b (patch) | |
tree | f8da11433a6a8f9c1d9a6db02e591e7e704c691c | |
parent | e475b4657527f8de436f11381b3d331bf7116d15 (diff) | |
download | kit-b0811b24d400aaab3629440c0da9fd792b22f55b.zip |
[atomic] memory_order for load on Windows
-rw-r--r-- | source/kit/atomic.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/kit/atomic.c b/source/kit/atomic.c index 33d355a..fc5b53d 100644 --- a/source/kit/atomic.c +++ b/source/kit/atomic.c @@ -25,7 +25,9 @@ void kit_atomic_store_explicit(volatile KIT_ATOMIC_VAR *var, KIT_ATOMIC_VAR kit_atomic_load_explicit(volatile KIT_ATOMIC_VAR *var, int memory_order) { - return *var; + if (memory_order == memory_order_relaxed) + return *var; + return InterlockedExchangeAdd_(var, 0); } KIT_ATOMIC_VAR kit_atomic_fetch_add_explicit( |