diff --git a/tdactor/td/actor/impl/Scheduler.h b/tdactor/td/actor/impl/Scheduler.h index ac450c88..f36ca8d4 100644 --- a/tdactor/td/actor/impl/Scheduler.h +++ b/tdactor/td/actor/impl/Scheduler.h @@ -229,37 +229,40 @@ void Scheduler::send_impl(const ActorId<> &actor_id, const RunFuncT &run_func, c template void Scheduler::send_lambda(ActorRef actor_ref, EventT &&lambda) { - return send_impl(actor_ref.get(), - [&](ActorInfo *actor_info) { - event_context_ptr_->link_token = actor_ref.token(); - lambda(); - }, - [&]() { - auto event = Event::lambda(std::forward(lambda)); - event.set_link_token(actor_ref.token()); - return std::move(event); - }); + return send_impl( + actor_ref.get(), + [&](ActorInfo *actor_info) { + event_context_ptr_->link_token = actor_ref.token(); + lambda(); + }, + [&]() { + auto event = Event::lambda(std::forward(lambda)); + event.set_link_token(actor_ref.token()); + return std::move(event); + }); } template void Scheduler::send_closure(ActorRef actor_ref, EventT &&closure) { - return send_impl(actor_ref.get(), - [&](ActorInfo *actor_info) { - event_context_ptr_->link_token = actor_ref.token(); - closure.run(static_cast(actor_info->get_actor_unsafe())); - }, - [&]() { - auto event = Event::immediate_closure(std::forward(closure)); - event.set_link_token(actor_ref.token()); - return std::move(event); - }); + return send_impl( + actor_ref.get(), + [&](ActorInfo *actor_info) { + event_context_ptr_->link_token = actor_ref.token(); + closure.run(static_cast(actor_info->get_actor_unsafe())); + }, + [&]() { + auto event = Event::immediate_closure(std::forward(closure)); + event.set_link_token(actor_ref.token()); + return std::move(event); + }); } template void Scheduler::send(ActorRef actor_ref, Event &&event) { event.set_link_token(actor_ref.token()); - return send_impl(actor_ref.get(), [&](ActorInfo *actor_info) { do_event(actor_info, std::move(event)); }, - [&]() { return std::move(event); }); + return send_impl( + actor_ref.get(), [&](ActorInfo *actor_info) { do_event(actor_info, std::move(event)); }, + [&]() { return std::move(event); }); } inline void Scheduler::subscribe(PollableFd fd, PollFlags flags) { @@ -293,7 +296,7 @@ inline uint64 Scheduler::get_link_token(Actor *actor) { return get_link_token(actor->get_info()); } inline uint64 Scheduler::get_link_token(ActorInfo *actor_info) { - CHECK(event_context_ptr_->actor_info == actor_info); + LOG_CHECK(event_context_ptr_->actor_info == actor_info) << actor_info->get_name(); return event_context_ptr_->link_token; }