Commit 45b505c930

Andrew Kelley <andrew@ziglang.org>
2024-05-27 19:49:26
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 parent c9587d3
Changed files (1)
lib
lib/std/process.zig
@@ -1760,6 +1760,7 @@ pub fn cleanExit() void {
     if (builtin.mode == .Debug) {
         return;
     } else {
+        std.debug.lockStdErr();
         exit(0);
     }
 }