std.process.cleanExit: lock stderr before exiting

This makes it so that any other threads which are writing to stderr have
a chance to finish before the process terminates. It also clears the
terminal in case any progress has been written to stderr, while still
accomplishing the goal of not waiting until the update thread exits.
This commit is contained in:
Andrew Kelley 2024-05-27 10:49:26 -07:00
parent c9587d3e40
commit 45b505c930

View File

@ -1760,6 +1760,7 @@ pub fn cleanExit() void {
if (builtin.mode == .Debug) {
return;
} else {
std.debug.lockStdErr();
exit(0);
}
}