summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index 646223e8f5..cf667e19db 100644
--- a/thread.c
+++ b/thread.c
@@ -2235,6 +2235,7 @@ rb_thread_wait_fd_rw(int fd, int read)
if (fd < 0) {
rb_raise(rb_eIOError, "closed stream");
}
+ if (rb_thread_alone()) return;
while (result <= 0) {
rb_fdset_t set;
rb_fd_init(&set);