ruby-changes:65153
From: Koichi <ko1@a...>
Date: Fri, 5 Feb 2021 15:33:35 +0900 (JST)
Subject: [ruby-changes:65153] b2674c1fd7 (master): unblock thread is only for main ractor.
https://git.ruby-lang.org/ruby.git/commit/?id=b2674c1fd7 From b2674c1fd725b43adf51af7935c780359d70c2a4 Mon Sep 17 00:00:00 2001 From: Koichi Sasada <ko1@a...> Date: Fri, 5 Feb 2021 15:30:53 +0900 Subject: unblock thread is only for main ractor. other ractors should not have a unblock thread. This patch fixes 6f727853cee41195b67ee5d793c1ac23fe1a6ae0. --- thread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/thread.c b/thread.c index f1d8c9a..e368948 100644 --- a/thread.c +++ b/thread.c @@ -1659,8 +1659,8 @@ rb_nogvl(void *(*func)(void *), void *data1, https://github.com/ruby/ruby/blob/trunk/thread.c#L1659 ubf = ubf_select; data2 = th; } - else if (ubf && rb_ractor_living_thread_num(th->ractor) == 1) { - if (is_main_thread && flags & RB_NOGVL_UBF_ASYNC_SAFE) { + else if (ubf && rb_ractor_living_thread_num(th->ractor) == 1 && is_main_thread) { + if (flags & RB_NOGVL_UBF_ASYNC_SAFE) { vm->ubf_async_safe = 1; } else { -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/