aboutsummaryrefslogtreecommitdiffstats
path: root/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/thread.c b/thread.c
index da834974bd..cc6e5533c0 100644
--- a/thread.c
+++ b/thread.c
@@ -2212,10 +2212,16 @@ rb_notify_fd_close(int fd)
list_for_each(&vm->waiting_fds, wfd, wfd_node) {
if (wfd->fd == fd) {
rb_thread_t *th = wfd->th;
- VALUE err = th->vm->special_exceptions[ruby_error_stream_closed];
+ VALUE err;
+
+ busy = 1;
+ if (!th) {
+ continue;
+ }
+ wfd->th = 0;
+ err = th->vm->special_exceptions[ruby_error_stream_closed];
rb_threadptr_pending_interrupt_enque(th, err);
rb_threadptr_interrupt(th);
- busy = 1;
}
}
return busy;