diff options
author | agri <agri@yandex-team.ru> | 2022-02-10 16:48:12 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:12 +0300 |
commit | 2909866fbc652492b7d7cab3023cb19489dc4fd8 (patch) | |
tree | b222e5ac2e2e98872661c51ccceee5da0d291e13 /util/system/atomic_ops.h | |
parent | d3530b2692e400bd4d29bd4f07cafaee139164e7 (diff) | |
download | ydb-2909866fbc652492b7d7cab3023cb19489dc4fd8.tar.gz |
Restoring authorship annotation for <agri@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/system/atomic_ops.h')
-rw-r--r-- | util/system/atomic_ops.h | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/util/system/atomic_ops.h b/util/system/atomic_ops.h index 532e5b5bcb..76766b4a0a 100644 --- a/util/system/atomic_ops.h +++ b/util/system/atomic_ops.h @@ -40,41 +40,41 @@ inline TEnableIfCastable<T, T> AtomicIncrement(T volatile& target) { } template <typename T> -inline TEnableIfCastable<T, T> AtomicGetAndIncrement(T volatile& target) { - return static_cast<T>(AtomicGetAndIncrement(*AsAtomicPtr(&target))); -} - -template <typename T> +inline TEnableIfCastable<T, T> AtomicGetAndIncrement(T volatile& target) { + return static_cast<T>(AtomicGetAndIncrement(*AsAtomicPtr(&target))); +} + +template <typename T> inline TEnableIfCastable<T, T> AtomicDecrement(T volatile& target) { return static_cast<T>(AtomicDecrement(*AsAtomicPtr(&target))); } template <typename T> -inline TEnableIfCastable<T, T> AtomicGetAndDecrement(T volatile& target) { - return static_cast<T>(AtomicGetAndDecrement(*AsAtomicPtr(&target))); -} - -template <typename T> +inline TEnableIfCastable<T, T> AtomicGetAndDecrement(T volatile& target) { + return static_cast<T>(AtomicGetAndDecrement(*AsAtomicPtr(&target))); +} + +template <typename T> inline TEnableIfCastable<T, T> AtomicAdd(T volatile& target, TAtomicBase value) { return static_cast<T>(AtomicAdd(*AsAtomicPtr(&target), value)); } template <typename T> -inline TEnableIfCastable<T, T> AtomicGetAndAdd(T volatile& target, TAtomicBase value) { - return static_cast<T>(AtomicGetAndAdd(*AsAtomicPtr(&target), value)); -} - -template <typename T> +inline TEnableIfCastable<T, T> AtomicGetAndAdd(T volatile& target, TAtomicBase value) { + return static_cast<T>(AtomicGetAndAdd(*AsAtomicPtr(&target), value)); +} + +template <typename T> inline TEnableIfCastable<T, T> AtomicSub(T volatile& target, TAtomicBase value) { return static_cast<T>(AtomicSub(*AsAtomicPtr(&target), value)); } template <typename T> -inline TEnableIfCastable<T, T> AtomicGetAndSub(T volatile& target, TAtomicBase value) { - return static_cast<T>(AtomicGetAndSub(*AsAtomicPtr(&target), value)); -} - -template <typename T> +inline TEnableIfCastable<T, T> AtomicGetAndSub(T volatile& target, TAtomicBase value) { + return static_cast<T>(AtomicGetAndSub(*AsAtomicPtr(&target), value)); +} + +template <typename T> inline TEnableIfCastable<T, T> AtomicSwap(T volatile* target, TAtomicBase exchange) { return static_cast<T>(AtomicSwap(AsAtomicPtr(target), exchange)); } @@ -85,11 +85,11 @@ inline TEnableIfCastable<T, bool> AtomicCas(T volatile* target, TAtomicBase exch } template <typename T> -inline TEnableIfCastable<T, T> AtomicGetAndCas(T volatile* target, TAtomicBase exchange, TAtomicBase compare) { - return static_cast<T>(AtomicGetAndCas(AsAtomicPtr(target), exchange, compare)); -} - -template <typename T> +inline TEnableIfCastable<T, T> AtomicGetAndCas(T volatile* target, TAtomicBase exchange, TAtomicBase compare) { + return static_cast<T>(AtomicGetAndCas(AsAtomicPtr(target), exchange, compare)); +} + +template <typename T> inline TEnableIfCastable<T, bool> AtomicTryLock(T volatile* target) { return AtomicTryLock(AsAtomicPtr(target)); } @@ -154,36 +154,36 @@ inline bool AtomicCas(T* volatile* target, T* exchange, T* compare) { } template <typename T> -inline T* AtomicGetAndCas(T* volatile* target, T* exchange, T* compare) { - return reinterpret_cast<T*>(AtomicGetAndCas(AsAtomicPtr(target), reinterpret_cast<TAtomicBase>(exchange), reinterpret_cast<TAtomicBase>(compare))); -} - -template <typename T> +inline T* AtomicGetAndCas(T* volatile* target, T* exchange, T* compare) { + return reinterpret_cast<T*>(AtomicGetAndCas(AsAtomicPtr(target), reinterpret_cast<TAtomicBase>(exchange), reinterpret_cast<TAtomicBase>(compare))); +} + +template <typename T> inline bool AtomicCas(T* volatile* target, T* exchange, TNullPtr) { return AtomicCas(AsAtomicPtr(target), reinterpret_cast<TAtomicBase>(exchange), 0); } template <typename T> -inline T* AtomicGetAndCas(T* volatile* target, T* exchange, TNullPtr) { - return reinterpret_cast<T*>(AtomicGetAndCas(AsAtomicPtr(target), reinterpret_cast<TAtomicBase>(exchange), 0)); -} - -template <typename T> +inline T* AtomicGetAndCas(T* volatile* target, T* exchange, TNullPtr) { + return reinterpret_cast<T*>(AtomicGetAndCas(AsAtomicPtr(target), reinterpret_cast<TAtomicBase>(exchange), 0)); +} + +template <typename T> inline bool AtomicCas(T* volatile* target, TNullPtr, T* compare) { return AtomicCas(AsAtomicPtr(target), 0, reinterpret_cast<TAtomicBase>(compare)); } template <typename T> -inline T* AtomicGetAndCas(T* volatile* target, TNullPtr, T* compare) { - return reinterpret_cast<T*>(AtomicGetAndCas(AsAtomicPtr(target), 0, reinterpret_cast<TAtomicBase>(compare))); -} - -template <typename T> +inline T* AtomicGetAndCas(T* volatile* target, TNullPtr, T* compare) { + return reinterpret_cast<T*>(AtomicGetAndCas(AsAtomicPtr(target), 0, reinterpret_cast<TAtomicBase>(compare))); +} + +template <typename T> inline bool AtomicCas(T* volatile* target, TNullPtr, TNullPtr) { return AtomicCas(AsAtomicPtr(target), 0, 0); } - -template <typename T> -inline T* AtomicGetAndCas(T* volatile* target, TNullPtr, TNullPtr) { - return reinterpret_cast<T*>(AtomicGetAndCas(AsAtomicPtr(target), 0, 0)); -} + +template <typename T> +inline T* AtomicGetAndCas(T* volatile* target, TNullPtr, TNullPtr) { + return reinterpret_cast<T*>(AtomicGetAndCas(AsAtomicPtr(target), 0, 0)); +} |