diff options
| author | robot-piglet <[email protected]> | 2026-01-16 01:52:30 +0300 |
|---|---|---|
| committer | robot-piglet <[email protected]> | 2026-01-16 02:04:37 +0300 |
| commit | ec287d71d6cc8fb776662e4e7f2409d3036769fe (patch) | |
| tree | 06256105cf6247fd26bf37f6942a696d023384b8 /library/cpp | |
| parent | 1b3a3f2dab8e4f3ca7623c92f8f01a5177a8d7ff (diff) | |
Intermediate changes
commit_hash:e2a707e415a488963509ff8fd5a9609c8e77b16d
Diffstat (limited to 'library/cpp')
| -rw-r--r-- | library/cpp/neh/rpc.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/library/cpp/neh/rpc.cpp b/library/cpp/neh/rpc.cpp index 13813bea1fc..943b144d1fe 100644 --- a/library/cpp/neh/rpc.cpp +++ b/library/cpp/neh/rpc.cpp @@ -9,6 +9,8 @@ #include <util/thread/factory.h> #include <util/system/spinlock.h> +#include <atomic> + using namespace NNeh; namespace { @@ -69,7 +71,7 @@ namespace { TGuard<TSpinLock> guard(L_); push_back(std::make_pair(service, srv)); - AtomicIncrement(SelfVersion_); + ++SelfVersion_; } inline void Listen() { @@ -213,7 +215,7 @@ namespace { } inline bool UpdateServices(TSrvs& srvs, i64& version) const { - if (AtomicGet(SelfVersion_) == version) { + if (SelfVersion_.load() == version) { return false; } @@ -224,7 +226,7 @@ namespace { for (const auto& it : *this) { srvs[TParsedLocation(it.first).Service] = it.second; } - version = AtomicGet(SelfVersion_); + version = SelfVersion_.load(); return true; } @@ -246,7 +248,7 @@ namespace { TSpinLock L_; IRequestQueueRef RQ_; THolder<TLoopFunc> LF_; - TAtomic SelfVersion_ = 1; + std::atomic<i64> SelfVersion_ = 1; TCheck C_; NThreading::TThreadLocalValue<TVersionedServiceMap> LocalMap_; |
