diff options
author | melkov <melkov@yandex-team.ru> | 2022-02-10 16:48:14 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:14 +0300 |
commit | 2c532b38e6aeb4fd88531027c7335690fd34c4e5 (patch) | |
tree | b222e5ac2e2e98872661c51ccceee5da0d291e13 /util/system/atomic_win.h | |
parent | 438546c8737d5c1fdeb31157dcf999717d930eec (diff) | |
download | ydb-2c532b38e6aeb4fd88531027c7335690fd34c4e5.tar.gz |
Restoring authorship annotation for <melkov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/system/atomic_win.h')
-rw-r--r-- | util/system/atomic_win.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/util/system/atomic_win.h b/util/system/atomic_win.h index 084c4c8859..65c290e6cc 100644 --- a/util/system/atomic_win.h +++ b/util/system/atomic_win.h @@ -1,5 +1,5 @@ #pragma once - + #include <intrin.h> #define USE_GENERIC_SETGET @@ -14,7 +14,7 @@ static inline intptr_t AtomicIncrement(TAtomic& a) { return _InterlockedIncrement((volatile long*)&a); -} +} static inline intptr_t AtomicGetAndIncrement(TAtomic& a) { return _InterlockedIncrement((volatile long*)&a) - 1; @@ -22,7 +22,7 @@ static inline intptr_t AtomicGetAndIncrement(TAtomic& a) { static inline intptr_t AtomicDecrement(TAtomic& a) { return _InterlockedDecrement((volatile long*)&a); -} +} static inline intptr_t AtomicGetAndDecrement(TAtomic& a) { return _InterlockedDecrement((volatile long*)&a) + 1; @@ -30,7 +30,7 @@ static inline intptr_t AtomicGetAndDecrement(TAtomic& a) { static inline intptr_t AtomicAdd(TAtomic& a, intptr_t b) { return _InterlockedExchangeAdd((volatile long*)&a, b) + b; -} +} static inline intptr_t AtomicGetAndAdd(TAtomic& a, intptr_t b) { return _InterlockedExchangeAdd((volatile long*)&a, b); @@ -39,7 +39,7 @@ static inline intptr_t AtomicGetAndAdd(TAtomic& a, intptr_t b) { static inline intptr_t AtomicSwap(TAtomic* a, intptr_t b) { return _InterlockedExchange((volatile long*)a, b); } - + static inline bool AtomicCas(TAtomic* a, intptr_t exchange, intptr_t compare) { return _InterlockedCompareExchange((volatile long*)a, exchange, compare) == compare; } |