Skip to content

Commit

Permalink
unblock thread is only for main ractor.
Browse files Browse the repository at this point in the history
other ractors should not have a unblock thread.
This patch fixes 6f72785.
  • Loading branch information
ko1 committed Feb 5, 2021
1 parent 7baedef commit b2674c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -1659,8 +1659,8 @@ rb_nogvl(void *(*func)(void *), void *data1,
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 {
Expand Down

0 comments on commit b2674c1

Please sign in to comment.