mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-14 23:09:16 +00:00
Write more tests for signal handling
There's now a much stronger level of assurance that signaling on Windows will be atomic, low-latency, low tail latency, and shall never deadlock.
This commit is contained in:
parent
0e59afb403
commit
dd8c4dbd7d
19 changed files with 407 additions and 75 deletions
1
third_party/nsync/common.c
vendored
1
third_party/nsync/common.c
vendored
|
@ -182,7 +182,6 @@ static void free_waiters_populate (void) {
|
|||
int n;
|
||||
if (IsNetbsd ()) {
|
||||
// netbsd needs a real file descriptor per semaphore
|
||||
// tim cook wants us to use his lol central dispatch
|
||||
n = 1;
|
||||
} else {
|
||||
n = __pagesize / sizeof(waiter);
|
||||
|
|
2
third_party/nsync/futex.c
vendored
2
third_party/nsync/futex.c
vendored
|
@ -185,7 +185,7 @@ static int nsync_futex_wait_win32_ (atomic_int *w, int expect, char pshare,
|
|||
}
|
||||
ok = WaitOnAddress (w, &expect, sizeof(int), nsync_time_64to32u (timespec_tomillis (wait)));
|
||||
if (pt) {
|
||||
/* __sig_cancel wakes our futex without changing `w` after enqueing signals */
|
||||
/* __sig_wake wakes our futex without changing `w` after enqueing signals */
|
||||
atomic_store_explicit (&pt->pt_blocker, 0, memory_order_release);
|
||||
if (ok && atomic_load_explicit (w, memory_order_acquire) == expect && (sig = __sig_get (waitmask))) {
|
||||
__sig_relay (sig, SI_KERNEL, waitmask);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue