mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
Even better idle waiting method
This commit is contained in:
parent
e496ef26da
commit
2501e80500
@ -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 => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user