Skip to content

Commit c22166a

Browse files
author
cherepashka
committed
Fix cosmetics issues
commit_hash:1a8ca312f9c2163d4915044450126d964643e922
1 parent 61ea5fc commit c22166a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

yt/yt/core/concurrency/async_semaphore.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void TAsyncSemaphore::Release(i64 slots)
5151
{
5252
auto guard = WriterGuard(SpinLock_);
5353
auto frontWaiterOverdraftsSlots = [&] {
54-
return IsOverdraftingAvailable() && !Waiters_.empty() && Waiters_.front().Slots > TotalSlots_;
54+
return CanOverdraft() && !Waiters_.empty() && Waiters_.front().Slots > TotalSlots_;
5555
};
5656
auto frontWaiterCanAcquireSlots = [&] {
5757
return !Waiters_.empty() && FreeSlots_ >= Waiters_.front().Slots;
@@ -105,7 +105,7 @@ bool TAsyncSemaphore::TryAcquire(i64 slots)
105105

106106
auto guard = WriterGuard(SpinLock_);
107107

108-
if (FreeSlots_ >= slots || IsOverdraftingAvailable()) {
108+
if (FreeSlots_ >= slots || CanOverdraft()) {
109109
FreeSlots_ -= slots;
110110
return true;
111111
}
@@ -118,7 +118,7 @@ TFuture<TAsyncSemaphoreGuard> TAsyncSemaphore::AsyncAcquire(i64 slots)
118118

119119
auto guard = WriterGuard(SpinLock_);
120120

121-
if (FreeSlots_ >= slots || IsOverdraftingAvailable()) {
121+
if (FreeSlots_ >= slots || CanOverdraft()) {
122122
FreeSlots_ -= slots;
123123
return MakeFuture(TAsyncSemaphoreGuard(this, slots));
124124
} else {
@@ -176,7 +176,7 @@ TFuture<void> TAsyncSemaphore::GetReadyEvent()
176176
return ReadyEvent_.ToFuture().ToUncancelable();
177177
}
178178

179-
bool TAsyncSemaphore::IsOverdraftingAvailable() const
179+
bool TAsyncSemaphore::CanOverdraft() const
180180
{
181181
YT_ASSERT_SPINLOCK_AFFINITY(SpinLock_);
182182

yt/yt/core/concurrency/async_semaphore.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class TAsyncSemaphore
109109

110110
std::queue<TWaiter> Waiters_;
111111

112-
bool IsOverdraftingAvailable() const;
112+
bool CanOverdraft() const;
113113
};
114114

115115
DEFINE_REFCOUNTED_TYPE(TAsyncSemaphore)

yt/yt/core/concurrency/unittests/async_semaphore_ut.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ TEST(TAsyncSemaphoreTest, OverdraftSlots)
8282
.Run());
8383
}
8484

85-
// Concurrently with "fat" requests above decrease total slots count in semaphore.
85+
// Concurrently with "fat" requests above decrease total slot count in semaphore.
8686
futures.push_back(BIND([
8787
&semaphore,
8888
barrierFuture = barrierPromise.ToFuture()

0 commit comments

Comments
 (0)