ruby-changes:63480
From: Koichi <ko1@a...>
Date: Fri, 30 Oct 2020 16:52:39 +0900 (JST)
Subject: [ruby-changes:63480] 08ddc335ea (master): sync vm->waiting_fds correctly.
https://git.ruby-lang.org/ruby.git/commit/?id=08ddc335ea From 08ddc335ea34829df756c164ceb13c56f0377d37 Mon Sep 17 00:00:00 2001 From: Koichi Sasada <ko1@a...> Date: Fri, 30 Oct 2020 16:47:08 +0900 Subject: sync vm->waiting_fds correctly. vm->waiting_fds is global resource so we need to lock it correctly. (forgot to sync one place) diff --git a/thread.c b/thread.c index 007a5cb..1512d64 100644 --- a/thread.c +++ b/thread.c @@ -4504,7 +4504,13 @@ rb_thread_wait_for_single_fd(int fd, int events, struct timeval *timeout) https://github.com/ruby/ruby/blob/trunk/thread.c#L4504 } while (wait_retryable(&result, lerrno, to, end)); } EC_POP_TAG(); - list_del(&wfd.wfd_node); + + RB_VM_LOCK_ENTER(); + { + list_del(&wfd.wfd_node); + } + RB_VM_LOCK_LEAVE(); + if (state) { EC_JUMP_TAG(wfd.th->ec, state); } -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/