diff options
| author | tobo <[email protected]> | 2026-01-28 15:51:45 +0300 |
|---|---|---|
| committer | tobo <[email protected]> | 2026-01-28 16:10:43 +0300 |
| commit | 019e06985a04afa59278a8643704ef0e89f0902b (patch) | |
| tree | cc85894c5117c7aba455fdaf19dd04edf18598e5 /library/cpp/threading/atomic | |
| parent | e079adcc58d008177b3ee55b6be076679ec0c381 (diff) | |
TAtomic => std::atomic in library/cpp/threading/atomic
commit_hash:d3337fcf8e16f28dc99d9466172f80b83d2fe569
Diffstat (limited to 'library/cpp/threading/atomic')
| -rw-r--r-- | library/cpp/threading/atomic/bool.h | 17 | ||||
| -rw-r--r-- | library/cpp/threading/atomic/ya.make | 4 |
2 files changed, 9 insertions, 12 deletions
diff --git a/library/cpp/threading/atomic/bool.h b/library/cpp/threading/atomic/bool.h index 6e336280ed5..cd9e3d32ad7 100644 --- a/library/cpp/threading/atomic/bool.h +++ b/library/cpp/threading/atomic/bool.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/deprecated/atomic/atomic.h> +#include <atomic> namespace NAtomic { class TBool { @@ -12,25 +12,26 @@ namespace NAtomic { { } - TBool(const TBool& src) noexcept { - AtomicSet(Val_, AtomicGet(src.Val_)); + TBool(const TBool& src) noexcept + : Val_(src.Val_.load()) + { } operator bool() const noexcept { - return AtomicGet(Val_); + return Val_.load(); } const TBool& operator=(bool val) noexcept { - AtomicSet(Val_, val); + Val_.store(val); return *this; } const TBool& operator=(const TBool& src) noexcept { - AtomicSet(Val_, AtomicGet(src.Val_)); + Val_.store(src.Val_.load()); return *this; } private: - TAtomic Val_ = 0; + std::atomic<bool> Val_ = false; }; -} +} // namespace NAtomic diff --git a/library/cpp/threading/atomic/ya.make b/library/cpp/threading/atomic/ya.make index e4dd81d9d3d..34b4ca4b208 100644 --- a/library/cpp/threading/atomic/ya.make +++ b/library/cpp/threading/atomic/ya.make @@ -4,10 +4,6 @@ SRCS( bool.cpp ) -PEERDIR( - library/cpp/deprecated/atomic -) - END() RECURSE_FOR_TESTS( |
