summaryrefslogtreecommitdiff
path: root/thread_pthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c8
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) {