summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-10-30 16:47:08 +0900
committerKoichi Sasada <ko1@atdot.net>2020-10-30 16:52:09 +0900
commit08ddc335ea34829df756c164ceb13c56f0377d37 (patch)
tree5a40bf42e6a2faacdd1cb29fa70d33c000af2d0f /thread.c
parenta1828a1ff455807f16eea265f7077d6475fee46a (diff)
sync vm->waiting_fds correctly.
vm->waiting_fds is global resource so we need to lock it correctly. (forgot to sync one place)
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c8
1 files changed, 7 insertions, 1 deletions
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)
} 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);
}