diff options
author | Anton Samokhvalov <[email protected]> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/messagebus/misc/atomic_box.h | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) |
Restoring authorship annotation for Anton Samokhvalov <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/messagebus/misc/atomic_box.h')
-rw-r--r-- | library/cpp/messagebus/misc/atomic_box.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/library/cpp/messagebus/misc/atomic_box.h b/library/cpp/messagebus/misc/atomic_box.h index 401621f9335..c36b6c747f0 100644 --- a/library/cpp/messagebus/misc/atomic_box.h +++ b/library/cpp/messagebus/misc/atomic_box.h @@ -12,23 +12,23 @@ private: T ValueForDebugger; }; - static_assert(sizeof(T) <= sizeof(TAtomic), "expect sizeof(T) <= sizeof(TAtomic)"); - + static_assert(sizeof(T) <= sizeof(TAtomic), "expect sizeof(T) <= sizeof(TAtomic)"); + public: - TAtomicBox(T value = T()) - : Value(value) - { - } + TAtomicBox(T value = T()) + : Value(value) + { + } void Set(T value) { - AtomicSet(Value, (TAtomic)value); + AtomicSet(Value, (TAtomic)value); } T Get() const { - return (T)AtomicGet(Value); + return (T)AtomicGet(Value); } bool CompareAndSet(T expected, T set) { - return AtomicCas(&Value, (TAtomicBase)set, (TAtomicBase)expected); + return AtomicCas(&Value, (TAtomicBase)set, (TAtomicBase)expected); } }; |