Overhaul Windows signal handling

The new asynchronous signal delivery technique is now also being used
for tkill(), raise(), etc. Many subtle issues have been addresesd. We
now signal handling on Windows that's remarkably similar to the POSIX
behaviors. However that's just across threads. We're lacking a way to
have the signal semantics work well, across multiple WIN32 processes.
This commit is contained in:
Justine Tunney 2023-09-08 01:49:41 -07:00
parent 8bdaddd81d
commit 99dc1281f5
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
38 changed files with 635 additions and 279 deletions

View file

@ -23,9 +23,7 @@
#ifdef __x86_64__
// TODO(jart): uc_sigmask support
privileged void _ntcontext2linux(ucontext_t *ctx, const struct NtContext *cr) {
textwindows void _ntcontext2linux(ucontext_t *ctx, const struct NtContext *cr) {
if (!cr) return;
ctx->uc_mcontext.eflags = cr->EFlags;
ctx->uc_mcontext.rax = cr->Rax;
@ -52,7 +50,7 @@ privileged void _ntcontext2linux(ucontext_t *ctx, const struct NtContext *cr) {
__repmovsb(&ctx->__fpustate, &cr->FltSave, sizeof(ctx->__fpustate));
}
privileged void _ntlinux2context(struct NtContext *cr, const ucontext_t *ctx) {
textwindows void _ntlinux2context(struct NtContext *cr, const ucontext_t *ctx) {
if (!cr) return;
cr->EFlags = ctx->uc_mcontext.eflags;
cr->Rax = ctx->uc_mcontext.rax;