From 38be2b00ad69e82015808d7a073d2ec89c213751 Mon Sep 17 00:00:00 2001 From: Masaori Koshiba Date: Wed, 10 May 2023 07:56:40 +0900 Subject: [PATCH] Check the calling thread of Ethread::schedule_local --- iocore/eventsystem/P_UnixEThread.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iocore/eventsystem/P_UnixEThread.h b/iocore/eventsystem/P_UnixEThread.h index b1824630c25..a5b8e7fec74 100644 --- a/iocore/eventsystem/P_UnixEThread.h +++ b/iocore/eventsystem/P_UnixEThread.h @@ -205,6 +205,10 @@ EThread::schedule_local(Event *e) // The continuation that gets scheduled later is not always the // client VC, it can be HttpCacheSM etc. so save the flags e->continuation->control_flags.set_flags(get_cont_flags().get_flags()); + + // If you need to schedule an event from a different thread, use Ethread::schedule_imm/at/in/every functions + ink_release_assert(this == this_ethread()); + EventQueueExternal.enqueue_local(e); return e; }