authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-05-27 10:49:26-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-05-27 20:56:49-07:00
log45b505c93070cb0815e81c9e909e9ce840569af3
tree0c20697043349de6263de15cb6fd1d4f6cf84b77
parentc9587d3e4013011b703ded68aefafba41550bbd7

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.

1 files changed, 1 insertions(+), 0 deletions(-)

lib/std/process.zig+1
...@@ -1760,6 +1760,7 @@ pub fn cleanExit() void {...@@ -1760,6 +1760,7 @@ pub fn cleanExit() void {
1760 if (builtin.mode == .Debug) {1760 if (builtin.mode == .Debug) {
1761 return;1761 return;
1762 } else {1762 } else {
1763 std.debug.lockStdErr();
1763 exit(0);1764 exit(0);
1764 }1765 }
1765}1766}