aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-09-25 19:34:34 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-09-26 12:35:14 -0700
commit61b20105e43b0db6d6f459dcb42acdda0365e0a3 (patch)
tree7e1dbdbedb51447276a53dbb5f404214f879745a /src
parent70746d580c7096938446eb47f57242edf17a9caf (diff)
downloadzig-61b20105e43b0db6d6f459dcb42acdda0365e0a3.tar.gz
zig-61b20105e43b0db6d6f459dcb42acdda0365e0a3.zip
fix crash report not using mutexes correctly
Diffstat (limited to 'src')
-rw-r--r--src/crash_report.zig7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/crash_report.zig b/src/crash_report.zig
index e7a18d7f60..6f0820b782 100644
--- a/src/crash_report.zig
+++ b/src/crash_report.zig
@@ -321,9 +321,6 @@ const PanicSwitch = struct {
/// until all panicking threads have dumped their traces.
var panicking = std.atomic.Value(u8).init(0);
- // Locked to avoid interleaving panic messages from multiple threads.
- var panic_mutex = std.Thread.Mutex{};
-
/// Tracks the state of the current panic. If the code within the
/// panic triggers a secondary panic, this allows us to recover.
threadlocal var panic_state_raw: PanicState = .{};
@@ -391,7 +388,7 @@ const PanicSwitch = struct {
state.recover_stage = .release_ref_count;
- panic_mutex.lock();
+ std.debug.lockStdErr();
state.recover_stage = .release_mutex;
@@ -453,7 +450,7 @@ const PanicSwitch = struct {
noinline fn releaseMutex(state: *volatile PanicState) noreturn {
state.recover_stage = .abort;
- panic_mutex.unlock();
+ std.debug.unlockStdErr();
goTo(releaseRefCount, .{state});
}