diff options
| author | cherepashka <[email protected]> | 2025-06-18 23:56:26 +0300 |
|---|---|---|
| committer | cherepashka <[email protected]> | 2025-06-19 00:13:28 +0300 |
| commit | c22166a04af087fd20eb11d2d247e091f6905f00 (patch) | |
| tree | cb94663599ebd297970c28996b2cb89c686618fb | |
| parent | 61ea5fc0cd73730d5ae6a9186d8c15057f183095 (diff) | |
Fix cosmetics issues
commit_hash:1a8ca312f9c2163d4915044450126d964643e922
| -rw-r--r-- | yt/yt/core/concurrency/async_semaphore.cpp | 8 | ||||
| -rw-r--r-- | yt/yt/core/concurrency/async_semaphore.h | 2 | ||||
| -rw-r--r-- | yt/yt/core/concurrency/unittests/async_semaphore_ut.cpp | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/yt/yt/core/concurrency/async_semaphore.cpp b/yt/yt/core/concurrency/async_semaphore.cpp index 82a6ceaedab..a9e561a3496 100644 --- a/yt/yt/core/concurrency/async_semaphore.cpp +++ b/yt/yt/core/concurrency/async_semaphore.cpp @@ -51,7 +51,7 @@ void TAsyncSemaphore::Release(i64 slots) { auto guard = WriterGuard(SpinLock_); auto frontWaiterOverdraftsSlots = [&] { - return IsOverdraftingAvailable() && !Waiters_.empty() && Waiters_.front().Slots > TotalSlots_; + return CanOverdraft() && !Waiters_.empty() && Waiters_.front().Slots > TotalSlots_; }; auto frontWaiterCanAcquireSlots = [&] { return !Waiters_.empty() && FreeSlots_ >= Waiters_.front().Slots; @@ -105,7 +105,7 @@ bool TAsyncSemaphore::TryAcquire(i64 slots) auto guard = WriterGuard(SpinLock_); - if (FreeSlots_ >= slots || IsOverdraftingAvailable()) { + if (FreeSlots_ >= slots || CanOverdraft()) { FreeSlots_ -= slots; return true; } @@ -118,7 +118,7 @@ TFuture<TAsyncSemaphoreGuard> TAsyncSemaphore::AsyncAcquire(i64 slots) auto guard = WriterGuard(SpinLock_); - if (FreeSlots_ >= slots || IsOverdraftingAvailable()) { + if (FreeSlots_ >= slots || CanOverdraft()) { FreeSlots_ -= slots; return MakeFuture(TAsyncSemaphoreGuard(this, slots)); } else { @@ -176,7 +176,7 @@ TFuture<void> TAsyncSemaphore::GetReadyEvent() return ReadyEvent_.ToFuture().ToUncancelable(); } -bool TAsyncSemaphore::IsOverdraftingAvailable() const +bool TAsyncSemaphore::CanOverdraft() const { YT_ASSERT_SPINLOCK_AFFINITY(SpinLock_); diff --git a/yt/yt/core/concurrency/async_semaphore.h b/yt/yt/core/concurrency/async_semaphore.h index edd4d81e487..f6415c4b31d 100644 --- a/yt/yt/core/concurrency/async_semaphore.h +++ b/yt/yt/core/concurrency/async_semaphore.h @@ -109,7 +109,7 @@ private: std::queue<TWaiter> Waiters_; - bool IsOverdraftingAvailable() const; + bool CanOverdraft() const; }; DEFINE_REFCOUNTED_TYPE(TAsyncSemaphore) diff --git a/yt/yt/core/concurrency/unittests/async_semaphore_ut.cpp b/yt/yt/core/concurrency/unittests/async_semaphore_ut.cpp index 0ceb6ccfdc1..24c19aa83d8 100644 --- a/yt/yt/core/concurrency/unittests/async_semaphore_ut.cpp +++ b/yt/yt/core/concurrency/unittests/async_semaphore_ut.cpp @@ -82,7 +82,7 @@ TEST(TAsyncSemaphoreTest, OverdraftSlots) .Run()); } - // Concurrently with "fat" requests above decrease total slots count in semaphore. + // Concurrently with "fat" requests above decrease total slot count in semaphore. futures.push_back(BIND([ &semaphore, barrierFuture = barrierPromise.ToFuture() |
