Skip to content

Commit 9a1a3ce

Browse files
committed
Update thread.c
1 parent 2b7a055 commit 9a1a3ce

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

thread.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2751,6 +2751,7 @@ rb_thread_io_close_interrupt(struct rb_io *io)
27512751
// This is used to ensure the correct execution context is woken up after the blocking operation is interrupted:
27522752
io->wakeup_mutex = rb_mutex_new();
27532753

2754+
// We need to use a mutex here as entering the fiber scheduler may cause a context switch:
27542755
VALUE result = rb_mutex_synchronize(io->wakeup_mutex, thread_io_close_notify_all, (VALUE)io);
27552756

27562757
return (size_t)result;

0 commit comments

Comments
 (0)