diff options
author | Alexander Smirnov <alex@ydb.tech> | 2025-04-04 08:10:14 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2025-04-04 08:10:14 +0000 |
commit | 93e24a1b2003b226c26d4d24c4038df3c441897c (patch) | |
tree | 02b24e1074c609f2633c5e6282ca227f8cd77fe5 /library/cpp/neh/https.cpp | |
parent | 874f495f0ca11e54980e7120837b8504b393009b (diff) | |
parent | 099240b6b9d598e1178351c4324de0bae80ae98a (diff) | |
download | ydb-93e24a1b2003b226c26d4d24c4038df3c441897c.tar.gz |
Merge branch 'rightlib' into merge-libs-250404-0808
Diffstat (limited to 'library/cpp/neh/https.cpp')
-rw-r--r-- | library/cpp/neh/https.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/library/cpp/neh/https.cpp b/library/cpp/neh/https.cpp index ece7d3cf2d..99db8a44cc 100644 --- a/library/cpp/neh/https.cpp +++ b/library/cpp/neh/https.cpp @@ -11,7 +11,6 @@ #include <openssl/ssl.h> #include <openssl/err.h> -#include <openssl/bio.h> #include <openssl/x509v3.h> #include <library/cpp/openssl/init/init.h> @@ -26,12 +25,10 @@ #include <util/generic/list.h> #include <util/generic/utility.h> #include <util/network/socket.h> -#include <util/stream/str.h> #include <util/stream/zlib.h> #include <util/string/builder.h> #include <util/string/cast.h> #include <util/system/condvar.h> -#include <util/system/error.h> #include <util/system/types.h> #include <util/thread/factory.h> @@ -448,8 +445,7 @@ namespace NNeh { }; TConnCache() - : InPurging_(0) - , MaxConnId_(0) + : MaxConnId_(0) , Shutdown_(false) { T_ = SystemThreadFactory()->Run(this); @@ -557,7 +553,7 @@ namespace NNeh { private: void SuggestPurgeCache() { - if (AtomicTryLock(&InPurging_)) { + if (InPurging_.TryAcquire()) { //evaluate the usefulness of purging the cache //если в кеше мало соединений (< MaxConnId_/16 или 64), не чистим кеш if ((size_t)CachedConnections.Val() > (Min((size_t)MaxConnId_.load(std::memory_order_acquire), (size_t)1024U) >> 4)) { @@ -577,7 +573,7 @@ namespace NNeh { return; //memo: thread MUST unlock InPurging_ (see DoExecute()) } } - AtomicUnlock(&InPurging_); + InPurging_.Release(); } } @@ -594,7 +590,7 @@ namespace NNeh { PurgeCache(); - AtomicUnlock(&InPurging_); + InPurging_.Release(); } } @@ -660,7 +656,7 @@ namespace NNeh { NHttp::TLockFreeSequence<TConnList> Lst_; - TAtomic InPurging_; + TSpinLock InPurging_; std::atomic<size_t> MaxConnId_; TAutoPtr<IThreadFactory::IThread> T_; |