aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/actors
diff options
context:
space:
mode:
authorivanmorozov <ivanmorozov@yandex-team.com>2023-06-27 12:01:42 +0300
committerivanmorozov <ivanmorozov@yandex-team.com>2023-06-27 12:01:42 +0300
commit16e0cd5f5f63a590ff3cde07d28e292fdf0f28c1 (patch)
tree14913a1a1974951859d4ac970a5cbacff0410de3 /library/cpp/actors
parent5a92e94875413808828580bb1339531e52c17206 (diff)
downloadydb-16e0cd5f5f63a590ff3cde07d28e292fdf0f28c1.tar.gz
fix destructor usage with tls context
Diffstat (limited to 'library/cpp/actors')
-rw-r--r--library/cpp/actors/core/executor_thread.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/library/cpp/actors/core/executor_thread.cpp b/library/cpp/actors/core/executor_thread.cpp
index 10a35ff422..31b1362cbf 100644
--- a/library/cpp/actors/core/executor_thread.cpp
+++ b/library/cpp/actors/core/executor_thread.cpp
@@ -152,13 +152,12 @@ namespace NActors {
bool firstEvent = true;
bool preempted = false;
for (; Ctx.ExecutedEvents < Ctx.EventsPerMailbox; ++Ctx.ExecutedEvents) {
- TAutoPtr<IEventHandle> ev(mailbox->Pop());
- if (!!ev) {
+ if (TAutoPtr<IEventHandle> ev = mailbox->Pop()) {
NHPTimer::STime hpnow;
recipient = ev->GetRecipientRewrite();
+ TActorContext ctx(*mailbox, *this, hpprev, recipient);
+ TlsActivationContext = &ctx; // ensure dtor (if any) is called within actor system
if (actor = mailbox->FindActor(recipient.LocalId())) {
- TActorContext ctx(*mailbox, *this, hpprev, recipient);
- TlsActivationContext = &ctx;
// Since actor is not null there should be no exceptions
actorType = &typeid(*actor);