mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 23:08:31 +00:00
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:
parent
a657f3e878
commit
cdf556e7d2
15 changed files with 627 additions and 77 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue