aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/atomic_win.h
diff options
context:
space:
mode:
authoragri <agri@yandex-team.ru>2022-02-10 16:48:12 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:12 +0300
commitd3530b2692e400bd4d29bd4f07cafaee139164e7 (patch)
treeb7ae636a74490e649a2ed0fdd5361f1bec83b9f9 /util/system/atomic_win.h
parent0f4c5d1e8c0672bf0a1f2f2d8acac5ba24772435 (diff)
downloadydb-d3530b2692e400bd4d29bd4f07cafaee139164e7.tar.gz
Restoring authorship annotation for <agri@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/system/atomic_win.h')
-rw-r--r--util/system/atomic_win.h62
1 files changed, 31 insertions, 31 deletions
diff --git a/util/system/atomic_win.h b/util/system/atomic_win.h
index 65c290e6cc..40bcdad6b4 100644
--- a/util/system/atomic_win.h
+++ b/util/system/atomic_win.h
@@ -16,26 +16,26 @@ 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;
-}
-
+static inline intptr_t AtomicGetAndIncrement(TAtomic& a) {
+ return _InterlockedIncrement((volatile long*)&a) - 1;
+}
+
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;
-}
-
+static inline intptr_t AtomicGetAndDecrement(TAtomic& a) {
+ return _InterlockedDecrement((volatile long*)&a) + 1;
+}
+
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);
-}
-
+static inline intptr_t AtomicGetAndAdd(TAtomic& a, intptr_t b) {
+ return _InterlockedExchangeAdd((volatile long*)&a, b);
+}
+
static inline intptr_t AtomicSwap(TAtomic* a, intptr_t b) {
return _InterlockedExchange((volatile long*)a, b);
}
@@ -45,9 +45,9 @@ static inline bool AtomicCas(TAtomic* a, intptr_t exchange, intptr_t compare) {
}
static inline intptr_t AtomicGetAndCas(TAtomic* a, intptr_t exchange, intptr_t compare) {
- return _InterlockedCompareExchange((volatile long*)a, exchange, compare);
-}
-
+ return _InterlockedCompareExchange((volatile long*)a, exchange, compare);
+}
+
#else // _x86_64_
#pragma intrinsic(_InterlockedIncrement64)
@@ -60,26 +60,26 @@ static inline intptr_t AtomicIncrement(TAtomic& a) {
return _InterlockedIncrement64((volatile __int64*)&a);
}
-static inline intptr_t AtomicGetAndIncrement(TAtomic& a) {
- return _InterlockedIncrement64((volatile __int64*)&a) - 1;
-}
-
+static inline intptr_t AtomicGetAndIncrement(TAtomic& a) {
+ return _InterlockedIncrement64((volatile __int64*)&a) - 1;
+}
+
static inline intptr_t AtomicDecrement(TAtomic& a) {
return _InterlockedDecrement64((volatile __int64*)&a);
}
-static inline intptr_t AtomicGetAndDecrement(TAtomic& a) {
- return _InterlockedDecrement64((volatile __int64*)&a) + 1;
-}
-
+static inline intptr_t AtomicGetAndDecrement(TAtomic& a) {
+ return _InterlockedDecrement64((volatile __int64*)&a) + 1;
+}
+
static inline intptr_t AtomicAdd(TAtomic& a, intptr_t b) {
return _InterlockedExchangeAdd64((volatile __int64*)&a, b) + b;
}
-static inline intptr_t AtomicGetAndAdd(TAtomic& a, intptr_t b) {
- return _InterlockedExchangeAdd64((volatile __int64*)&a, b);
-}
-
+static inline intptr_t AtomicGetAndAdd(TAtomic& a, intptr_t b) {
+ return _InterlockedExchangeAdd64((volatile __int64*)&a, b);
+}
+
static inline intptr_t AtomicSwap(TAtomic* a, intptr_t b) {
return _InterlockedExchange64((volatile __int64*)a, b);
}
@@ -88,10 +88,10 @@ static inline bool AtomicCas(TAtomic* a, intptr_t exchange, intptr_t compare) {
return _InterlockedCompareExchange64((volatile __int64*)a, exchange, compare) == compare;
}
-static inline intptr_t AtomicGetAndCas(TAtomic* a, intptr_t exchange, intptr_t compare) {
- return _InterlockedCompareExchange64((volatile __int64*)a, exchange, compare);
-}
-
+static inline intptr_t AtomicGetAndCas(TAtomic* a, intptr_t exchange, intptr_t compare) {
+ return _InterlockedCompareExchange64((volatile __int64*)a, exchange, compare);
+}
+
static inline intptr_t AtomicOr(TAtomic& a, intptr_t b) {
return _InterlockedOr64(&a, b) | b;
}