| ... | @@ -321,9 +321,6 @@ const PanicSwitch = struct { | ... | @@ -321,9 +321,6 @@ const PanicSwitch = struct { |
| 321 | /// until all panicking threads have dumped their traces. | 321 | /// until all panicking threads have dumped their traces. |
| 322 | var panicking = std.atomic.Value(u8).init(0); | 322 | var panicking = std.atomic.Value(u8).init(0); |
| 323 | | 323 | |
| 324 | // Locked to avoid interleaving panic messages from multiple threads. | | |
| 325 | var panic_mutex = std.Thread.Mutex{}; | | |
| 326 | | | |
| 327 | /// Tracks the state of the current panic. If the code within the | 324 | /// Tracks the state of the current panic. If the code within the |
| 328 | /// panic triggers a secondary panic, this allows us to recover. | 325 | /// panic triggers a secondary panic, this allows us to recover. |
| 329 | threadlocal var panic_state_raw: PanicState = .{}; | 326 | threadlocal var panic_state_raw: PanicState = .{}; |
| ... | @@ -391,7 +388,7 @@ const PanicSwitch = struct { | ... | @@ -391,7 +388,7 @@ const PanicSwitch = struct { |
| 391 | | 388 | |
| 392 | state.recover_stage = .release_ref_count; | 389 | state.recover_stage = .release_ref_count; |
| 393 | | 390 | |
| 394 | panic_mutex.lock(); | 391 | std.debug.lockStdErr(); |
| 395 | | 392 | |
| 396 | state.recover_stage = .release_mutex; | 393 | state.recover_stage = .release_mutex; |
| 397 | | 394 | |
| ... | @@ -453,7 +450,7 @@ const PanicSwitch = struct { | ... | @@ -453,7 +450,7 @@ const PanicSwitch = struct { |
| 453 | noinline fn releaseMutex(state: *volatile PanicState) noreturn { | 450 | noinline fn releaseMutex(state: *volatile PanicState) noreturn { |
| 454 | state.recover_stage = .abort; | 451 | state.recover_stage = .abort; |
| 455 | | 452 | |
| 456 | panic_mutex.unlock(); | 453 | std.debug.unlockStdErr(); |
| 457 | | 454 | |
| 458 | goTo(releaseRefCount, .{state}); | 455 | goTo(releaseRefCount, .{state}); |
| 459 | } | 456 | } |