diff options
author | Jean Boussier <[email protected]> | 2022-06-07 17:18:50 +0200 |
---|---|---|
committer | Jean Boussier <[email protected]> | 2022-06-07 18:15:55 +0200 |
commit | 19c6aaca939e1d42030d171bc0e8f2098dc7f535 (patch) | |
tree | 8886ee122360834d7153f4a18853056521f22c70 /thread_pthread.c | |
parent | bdc6e991f553afc855fba1a3337cdfc799712c4e (diff) |
thread_pthread.c: trigger THREAD_EVENT_READY when going throuhg the fast path.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5985
Diffstat (limited to 'thread_pthread.c')
-rw-r--r-- | thread_pthread.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/thread_pthread.c b/thread_pthread.c index fee32bae34..9b0dddd562 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -377,6 +377,10 @@ thread_sched_to_ready_common(struct rb_thread_sched *sched, rb_thread_t *th) static void thread_sched_to_running_common(struct rb_thread_sched *sched, rb_thread_t *th) { + if (rb_internal_thread_event_hooks) { + rb_thread_execute_hooks(RUBY_INTERNAL_THREAD_EVENT_READY); + } + if (sched->running) { VM_ASSERT(th->unblock.func == 0 && "we must not be in ubf_list and GVL readyq at the same time"); @@ -384,10 +388,6 @@ thread_sched_to_running_common(struct rb_thread_sched *sched, rb_thread_t *th) // waiting -> ready thread_sched_to_ready_common(sched, th); - if (rb_internal_thread_event_hooks) { - rb_thread_execute_hooks(RUBY_INTERNAL_THREAD_EVENT_READY); - } - // wait for running chance do { if (!sched->timer) { |