tdactor: safe inheritance of tag_ in contexts

GitOrigin-RevId: db55e11f150be00560906a3f66510dbcfa6b347c
This commit is contained in:
Arseny Smirnov 2020-08-17 14:50:47 +03:00
parent dfb3e124b8
commit 94b78114e0

View File

@ -146,7 +146,9 @@ inline const Actor *ActorInfo::get_actor_unsafe() const {
inline std::shared_ptr<ActorContext> ActorInfo::set_context(std::shared_ptr<ActorContext> context) {
CHECK(is_running());
context->this_ptr_ = context;
context->tag_ = Scheduler::context()->tag_;
if (Scheduler::context()->tag_) {
context->set_tag(Scheduler::context()->tag_);
}
std::swap(context_, context);
Scheduler::context() = context_.get();
Scheduler::on_context_updated();