[前][次][番号順一覧][スレッド一覧]

ruby-changes:63243

From: Samuel <ko1@a...>
Date: Thu, 1 Oct 2020 17:39:00 +0900 (JST)
Subject: [ruby-changes:63243] 2db081b5ff (master): Don't use `th->scheduler` directly because it's not always valid to do so.

https://git.ruby-lang.org/ruby.git/commit/?id=2db081b5ff

From 2db081b5ffb07a2e6bdac58122fa3466830b12a9 Mon Sep 17 00:00:00 2001
From: Samuel Williams <samuel.williams@o...>
Date: Thu, 1 Oct 2020 20:22:55 +1300
Subject: Don't use `th->scheduler` directly because it's not always valid to
 do so.


diff --git a/thread.c b/thread.c
index 81172dc..6cc0a92 100644
--- a/thread.c
+++ b/thread.c
@@ -1175,8 +1175,10 @@ thread_join_sleep(VALUE arg) https://github.com/ruby/ruby/blob/trunk/thread.c#L1175
     }
 
     while (target_th->status != THREAD_KILLED) {
-        if (th->scheduler != Qnil) {
-            rb_scheduler_block(th->scheduler, target_th->self, p->timeout);
+        VALUE scheduler = rb_thread_current_scheduler();
+
+        if (scheduler != Qnil) {
+            rb_scheduler_block(scheduler, target_th->self, p->timeout);
         } else if (!limit) {
             th->status = THREAD_STOPPED_FOREVER;
             rb_ractor_sleeper_threads_inc(th->ractor);
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]