mirror of
https://github.com/ziglang/zig.git
synced 2026-01-02 03:25:01 +00:00
Applications supplying their own custom stack to pthread_create are not allowed to free the allocated memory after pthread_join returns as, according to the specification, the thread is not guaranteed to be dead after the join call returns. Avoid this class of problems by avoiding the use of a custom stack altogether, let pthread handle its own resources. Allocations made on the child stack are now done on the C heap. Thanks @semarie for noticing the problem on OpenBSD and suggesting a fix. Closes #7275