diff --git a/lib/std/debug.zig b/lib/std/debug.zig index cdbba2367bd2fb8b828d7ff037da61553bb8c838..f2c736bbbae761023ccc2f2a8c10adc2b46730ab 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -278,8 +278,11 @@ pub fn panicExtra(trace: ?*const builtin.StackTrace, first_trace_addr: ?usize, c // Another thread is panicking, wait for the last one to finish // and call abort() - // XXX: Find a nicer way to loop forever - while (true) {} + // Here we sleep forever without hammering the CPU by causing a + // deadlock + var deadlock = std.Mutex.init(); + _ = deadlock.acquire(); + _ = deadlock.acquire(); } }, 1 => {