diff options
author | arkady-e1ppa <arkady-e1ppa@yandex-team.com> | 2024-04-23 14:58:37 +0300 |
---|---|---|
committer | arkady-e1ppa <arkady-e1ppa@yandex-team.com> | 2024-04-23 15:16:05 +0300 |
commit | 9232d1fa6821f7f315a10df573de90d4949d9975 (patch) | |
tree | 002262f84498ff93ec101956ea13ec4ff03afdd5 | |
parent | e378d50b00432742f25d9f84f19ff6d513a457d8 (diff) | |
download | ydb-9232d1fa6821f7f315a10df573de90d4949d9975.tar.gz |
Another cosmetics fix in coroutines
e40b2460e82091e74f16ff3906b387242b96d34f
-rw-r--r-- | yt/yt/core/concurrency/coroutine-inl.h | 2 | ||||
-rw-r--r-- | yt/yt/core/concurrency/coroutine.cpp | 8 | ||||
-rw-r--r-- | yt/yt/core/concurrency/coroutine.h | 5 |
3 files changed, 8 insertions, 7 deletions
diff --git a/yt/yt/core/concurrency/coroutine-inl.h b/yt/yt/core/concurrency/coroutine-inl.h index 1a849112e1..879ceab35b 100644 --- a/yt/yt/core/concurrency/coroutine-inl.h +++ b/yt/yt/core/concurrency/coroutine-inl.h @@ -60,7 +60,7 @@ void TCoroutineBase::TTrampoLine<TBody>::DoRun() } } - owner->State_ = ECoroState::Completed; + owner->State_ = EState::Completed; owner->Suspend(); YT_ABORT(); diff --git a/yt/yt/core/concurrency/coroutine.cpp b/yt/yt/core/concurrency/coroutine.cpp index 6dc08abf5d..cc9d008c97 100644 --- a/yt/yt/core/concurrency/coroutine.cpp +++ b/yt/yt/core/concurrency/coroutine.cpp @@ -6,8 +6,8 @@ namespace NYT::NConcurrency::NDetail { TCoroutineBase::~TCoroutineBase() { - if (State_ == ECoroState::Running) { - State_ = ECoroState::Abandoned; + if (State_ == EState::Running) { + State_ = EState::Abandoned; Resume(); } @@ -18,7 +18,7 @@ void TCoroutineBase::Suspend() { std::launder(&CoroutineContext)->SwitchTo(&CallerContext_); - if (State_ == ECoroState::Abandoned) { + if (State_ == EState::Abandoned) { throw TCoroutineAbandonedException{}; } } @@ -36,7 +36,7 @@ void TCoroutineBase::Resume() bool TCoroutineBase::IsCompleted() const noexcept { - return State_ == ECoroState::Completed; + return State_ == EState::Completed; } //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/core/concurrency/coroutine.h b/yt/yt/core/concurrency/coroutine.h index ab827b2266..7b395585e9 100644 --- a/yt/yt/core/concurrency/coroutine.h +++ b/yt/yt/core/concurrency/coroutine.h @@ -40,7 +40,8 @@ protected: void Suspend(); private: - enum class ECoroState { + enum class EState + { Running, Abandoned, Completed, @@ -56,7 +57,7 @@ private: TExceptionSafeContext CoroutineContext; }; - ECoroState State_ = ECoroState::Running; + EState State_ = EState::Running; struct TCoroutineAbandonedException { }; |