This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.2.x by this push:
     new d60e6465f8 Check the calling thread of Ethread::schedule_local (#9691)
d60e6465f8 is described below

commit d60e6465f866c942c46f81d5f4f7208349f662db
Author: Masaori Koshiba <[email protected]>
AuthorDate: Tue May 16 07:35:15 2023 +0900

    Check the calling thread of Ethread::schedule_local (#9691)
    
    (cherry picked from commit 644658e090e135fb265547cc05a0b262a3a976f9)
---
 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 21ca05240d..772e7771e4 100644
--- a/iocore/eventsystem/P_UnixEThread.h
+++ b/iocore/eventsystem/P_UnixEThread.h
@@ -204,6 +204,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;
 }

Reply via email to