diff options
| author | robot-piglet <[email protected]> | 2025-04-03 10:30:34 +0300 |
|---|---|---|
| committer | robot-piglet <[email protected]> | 2025-04-03 10:44:25 +0300 |
| commit | 8864692b9fd121d13b69b7251a100c99940b09e8 (patch) | |
| tree | ffffe45235f93bda56c5bbc413f90d480884fbcd /library/cpp/neh/http2.cpp | |
| parent | 8ebf663ab7da3d503dc8294a305ea95503428275 (diff) | |
Intermediate changes
commit_hash:813f69d5cbf58ac7b580f7c6461a3be8afcc1671
Diffstat (limited to 'library/cpp/neh/http2.cpp')
| -rw-r--r-- | library/cpp/neh/http2.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/library/cpp/neh/http2.cpp b/library/cpp/neh/http2.cpp index f10fdc3b3e3..daf73ba0d1f 100644 --- a/library/cpp/neh/http2.cpp +++ b/library/cpp/neh/http2.cpp @@ -912,7 +912,6 @@ namespace { THttpConnManager() : TotalConn(0) , EP_(THttp2Options::AsioThreads) - , InPurging_(0) , MaxConnId_(0) , Shutdown_(false) { @@ -1011,7 +1010,7 @@ namespace { } void SuggestPurgeCache() { - if (AtomicTryLock(&InPurging_)) { + if (InPurging_.TryAcquire()) { //evaluate the usefulness of purging the cache //если в кеше мало соединений (< MaxConnId_/16 или 64), не чистим кеш if (Cache_.Size() > (Min((size_t)AtomicGet(MaxConnId_), (size_t)1024U) >> 4)) { @@ -1031,7 +1030,7 @@ namespace { return; //memo: thread MUST unlock InPurging_ (see DoExecute()) } } - AtomicUnlock(&InPurging_); + InPurging_.Release(); } } @@ -1049,7 +1048,7 @@ namespace { PurgeCache(); - AtomicUnlock(&InPurging_); + InPurging_.Release(); } } @@ -1076,7 +1075,7 @@ namespace { TExecutorsPool EP_; TConnCache<THttpConn> Cache_; - TAtomic InPurging_; + TSpinLock InPurging_; TAtomic MaxConnId_; TAutoPtr<IThreadFactory::IThread> T_; |
