Skip to content

Conversation

@LiterallyVoid
Copy link
Contributor

Fixes #4047.

This creates a separate thread to watch for signals. I used a pipe to send signals to the signal thread, as pipes are one of the few signal-safe messaging options.

Because GTK isn't thread safe, I couldn't handle signals in the signal thread either, so I used a SafeSignal which is thread-safe (but probably not signal-safe!) so that signals were handled on the main thread.

I also moved the SIGCHLD handling code into the new thread. I'm unsure about this change, as it will longer mask SIGCHLD in the main thread. From a cursory test it seems to work and children are still being reaped correctly, but I separated this change into its own commit so it can be reverted separately.

(Incidentally, all of reload's accesses were on the same thread, so I changed it from a global to a local.)

@Alexays Alexays merged commit 9ca04ee into Alexays:master Jun 22, 2025
8 of 9 checks passed
@Alexays
Copy link
Owner

Alexays commented Jun 22, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reproducible Deadlock

2 participants