From 45b505c93070cb0815e81c9e909e9ce840569af3 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 27 May 2024 10:49:26 -0700 Subject: [PATCH] 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. --- lib/std/process.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/std/process.zig b/lib/std/process.zig index 5fb36f991d3a444f986e816bd80a387010db740b..e55ce7ff4148d65975ada4ebeb9554ab6b7d38d9 100644 --- a/lib/std/process.zig +++ b/lib/std/process.zig @@ -1760,6 +1760,7 @@ pub fn cleanExit() void { if (builtin.mode == .Debug) { return; } else { + std.debug.lockStdErr(); exit(0); } } -- 2.54.0