Implement signal handler tail recursion

GNU Make on Windows now appears to be working reliably. This change also
fixes a bug where, after fork the Windows thread handle wasn't reset and
that caused undefined behavior using SetThreadContext() with our signals
This commit is contained in:
Justine Tunney 2023-10-14 10:29:26 -07:00
parent a657f3e878
commit cdf556e7d2
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
15 changed files with 627 additions and 77 deletions

View file

@ -29,7 +29,7 @@ struct Signals __sig;
sigset_t __sig_block(void) {
if (IsWindows()) {
return atomic_exchange_explicit(&__get_tls()->tib_sigmask, -1,
memory_order_acq_rel);
memory_order_acquire);
} else {
sigset_t res, neu = -1;
sys_sigprocmask(SIG_SETMASK, &neu, &res);
@ -55,7 +55,7 @@ textwindows int __sig_enqueue(int sig) {
textwindows sigset_t __sig_beginwait(sigset_t waitmask) {
return atomic_exchange_explicit(&__get_tls()->tib_sigmask, waitmask,
memory_order_acq_rel);
memory_order_acquire);
}
textwindows void __sig_finishwait(sigset_t m) {