Skip to content

Commit ba68343

Browse files
authored
Allow wakeup mutex to be used in trap context. (ruby#13684)
1 parent e036d4d commit ba68343

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
@@ -2847,6 +2847,7 @@ rb_thread_io_close_interrupt(struct rb_io *io)
28472847

28482848
// This is used to ensure the correct execution context is woken up after the blocking operation is interrupted:
28492849
io->wakeup_mutex = rb_mutex_new();
2850+
rb_mutex_allow_trap(io->wakeup_mutex, 1);
28502851

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

0 commit comments

Comments
 (0)