0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/lib/std/Thread.zig
Alex Rønne Petersen 2085096f50
std.Thread: fix freeAndExit() on sparc[64]-linux hardware
On SPARC, the kernel needs to be able to restore the current register window
from the stack when returning from a syscall. That presents a bit of a problem
in freeAndExit() since we're deallocating the stack! The good news is that,
since we do not care about the contents of the incoming and local registers at
that point, we can just tell the kernel that our stack is an undefined global
buffer.

This didn't manifest in QEMU but does reproduce deterministically on a real
kernel/machine.
2026-08-01 15:20:07 +02:00

1773 lines
66 KiB