diff options
author | kruall <kruall@ydb.tech> | 2022-12-20 11:48:30 +0300 |
---|---|---|
committer | kruall <kruall@ydb.tech> | 2022-12-20 11:48:30 +0300 |
commit | fbd79db653a5787d6025b0ed207ebde59748a16d (patch) | |
tree | 354c9535d7dd475616a37eedd61ad0eae746c908 | |
parent | d238c469aadb562f79ff0c394c83d6918197c606 (diff) | |
download | ydb-fbd79db653a5787d6025b0ed207ebde59748a16d.tar.gz |
Improve SendWithContinuousExecution,
-rw-r--r-- | library/cpp/actors/core/executor_pool_base.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/library/cpp/actors/core/executor_pool_base.cpp b/library/cpp/actors/core/executor_pool_base.cpp index fe46d56fdc..dd0490277c 100644 --- a/library/cpp/actors/core/executor_pool_base.cpp +++ b/library/cpp/actors/core/executor_pool_base.cpp @@ -72,12 +72,15 @@ namespace NActors { } } + Y_FORCE_INLINE bool IsSendingWithContinuousExecution(IExecutorPool *self) { + return TlsThreadContext && TlsThreadContext->Pool == self && TlsThreadContext->IsSendingWithContinuousExecution; + } + void TExecutorPoolBase::ScheduleActivation(ui32 activation) { - if (TlsThreadContext && TlsThreadContext->Pool == static_cast<IExecutorPool*>(this) && TlsThreadContext->IsSendingWithContinuousExecution - && !TlsThreadContext->WaitedActivation) - { - TlsThreadContext->WaitedActivation = activation; - } else { + if (IsSendingWithContinuousExecution(this)) { + std::swap(TlsThreadContext->WaitedActivation, activation); + } + if (activation) { ScheduleActivationEx(activation, AtomicIncrement(ActivationsRevolvingCounter)); } } |