thread_pthread.c: trigger THREAD_EVENT_READY when going throuhg the fast path.

This commit is contained in:
Jean Boussier 2022-06-07 17:18:50 +02:00
parent bdc6e991f5
commit 19c6aaca93
Notes: git 2022-06-08 01:16:24 +09:00
1 changed files with 4 additions and 4 deletions

View File

@ -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) {