We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b7a055 commit 9a1a3ceCopy full SHA for 9a1a3ce
thread.c
@@ -2751,6 +2751,7 @@ rb_thread_io_close_interrupt(struct rb_io *io)
2751
// This is used to ensure the correct execution context is woken up after the blocking operation is interrupted:
2752
io->wakeup_mutex = rb_mutex_new();
2753
2754
+ // We need to use a mutex here as entering the fiber scheduler may cause a context switch:
2755
VALUE result = rb_mutex_synchronize(io->wakeup_mutex, thread_io_close_notify_all, (VALUE)io);
2756
2757
return (size_t)result;
0 commit comments