Skip to content

Commit 411f214

Browse files
authored
Update thread.c
1 parent 2239ea0 commit 411f214

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
@@ -2750,6 +2750,7 @@ rb_thread_io_close_interrupt(struct rb_io *io)
27502750
// This is used to ensure the correct execution context is woken up after the blocking operation is interrupted:
27512751
io->wakeup_mutex = rb_mutex_new();
27522752

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

27552756
return (size_t)result;

0 commit comments

Comments
 (0)