| ... | ... | @@ -447,9 +447,6 @@ pub fn panicExtra( |
| 447 | 447 | /// The counter is incremented/decremented atomically. |
| 448 | 448 | var panicking = std.atomic.Value(u8).init(0); |
| 449 | 449 | |
| 450 | | // Locked to avoid interleaving panic messages from multiple threads. |
| 451 | | var panic_mutex = std.Thread.Mutex{}; |
| 452 | | |
| 453 | 450 | /// Counts how many times the panic handler is invoked by this thread. |
| 454 | 451 | /// This is used to catch and handle panics triggered by the panic handler. |
| 455 | 452 | threadlocal var panic_stage: usize = 0; |
| ... | ... | @@ -474,8 +471,8 @@ pub fn panicImpl(trace: ?*const std.builtin.StackTrace, first_trace_addr: ?usize |
| 474 | 471 | |
| 475 | 472 | // Make sure to release the mutex when done |
| 476 | 473 | { |
| 477 | | panic_mutex.lock(); |
| 478 | | defer panic_mutex.unlock(); |
| 474 | lockStdErr(); |
| 475 | defer unlockStdErr(); |
| 479 | 476 | |
| 480 | 477 | const stderr = io.getStdErr().writer(); |
| 481 | 478 | if (builtin.single_threaded) { |
| ... | ... | @@ -2604,8 +2601,8 @@ fn handleSegfaultPosix(sig: i32, info: *const posix.siginfo_t, ctx_ptr: ?*anyopa |
| 2604 | 2601 | _ = panicking.fetchAdd(1, .seq_cst); |
| 2605 | 2602 | |
| 2606 | 2603 | { |
| 2607 | | panic_mutex.lock(); |
| 2608 | | defer panic_mutex.unlock(); |
| 2604 | lockStdErr(); |
| 2605 | defer unlockStdErr(); |
| 2609 | 2606 | |
| 2610 | 2607 | dumpSegfaultInfoPosix(sig, code, addr, ctx_ptr); |
| 2611 | 2608 | } |
| ... | ... | @@ -2680,8 +2677,8 @@ fn handleSegfaultWindowsExtra( |
| 2680 | 2677 | _ = panicking.fetchAdd(1, .seq_cst); |
| 2681 | 2678 | |
| 2682 | 2679 | { |
| 2683 | | panic_mutex.lock(); |
| 2684 | | defer panic_mutex.unlock(); |
| 2680 | lockStdErr(); |
| 2681 | defer unlockStdErr(); |
| 2685 | 2682 | |
| 2686 | 2683 | dumpSegfaultInfoWindows(info, msg, label); |
| 2687 | 2684 | } |