Skip to content

Commit

Permalink
Initialize interrupt queue before signal handlers (#9196)
Browse files Browse the repository at this point in the history
  • Loading branch information
k0kubun committed Dec 12, 2023
1 parent 1e5c8af commit 9f0065a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion inits.c
Expand Up @@ -51,7 +51,6 @@ rb_call_inits(void)
CALL(Dir);
CALL(Time);
CALL(Random);
CALL(signal);
CALL(load);
CALL(Proc);
CALL(Binding);
Expand All @@ -63,6 +62,7 @@ rb_call_inits(void)
CALL(VM);
CALL(ISeq);
CALL(Thread);
CALL(signal);
CALL(Fiber_Scheduler);
CALL(process);
CALL(Cont);
Expand Down
3 changes: 3 additions & 0 deletions signal.c
Expand Up @@ -1488,6 +1488,9 @@ Init_signal(void)
rb_alias(rb_eSignal, rb_intern_const("signm"), rb_intern_const("message"));
rb_define_method(rb_eInterrupt, "initialize", interrupt_init, -1);

// It should be ready to call rb_signal_exec()
VM_ASSERT(GET_THREAD()->pending_interrupt_queue);

/* At this time, there is no subthread. Then sigmask guarantee atomics. */
rb_disable_interrupt();

Expand Down

0 comments on commit 9f0065a

Please sign in to comment.