diff options
| author | LemonBoy <thatlemon@gmail.com> | 2020-03-13 19:20:18 +0100 |
|---|---|---|
| committer | LemonBoy <thatlemon@gmail.com> | 2020-03-13 19:20:18 +0100 |
| commit | 2501e80500f99c1ede6daf2f7c50c2dec3c9675c (patch) | |
| tree | b98c7584811f2fa5114945d1c520d5444f91ebcb /lib/std/debug.zig | |
| parent | e496ef26dabb3a2da4821c7c0c2e4ffc6f7d86ce (diff) | |
| download | zig-2501e80500f99c1ede6daf2f7c50c2dec3c9675c.tar.gz zig-2501e80500f99c1ede6daf2f7c50c2dec3c9675c.zip | |
Even better idle waiting method
Diffstat (limited to 'lib/std/debug.zig')
| -rw-r--r-- | lib/std/debug.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig index f2c736bbba..5600990924 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -278,11 +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() - // Here we sleep forever without hammering the CPU by causing a - // deadlock - var deadlock = std.Mutex.init(); - _ = deadlock.acquire(); - _ = deadlock.acquire(); + // Sleep forever without hammering the CPU + var event = std.ResetEvent.init(); + event.wait(); + + unreachable; } }, 1 => { |
