| author | |
| committer | |
| log | e496ef26dabb3a2da4821c7c0c2e4ffc6f7d86ce |
| tree | 50b089136dca1e7b999caa60a49cd3a9355575ce |
| parent | edcf8e0636c5a2674ce2b3e568929232c8cc61eb |
Trying to acquire twice the same mutex generates an idle loop.1 files changed, 5 insertions(+), 2 deletions(-)
lib/std/debug.zig+5-2| ... | ... | @@ -278,8 +278,11 @@ pub fn panicExtra(trace: ?*const builtin.StackTrace, first_trace_addr: ?usize, c |
| 278 | 278 | // Another thread is panicking, wait for the last one to finish |
| 279 | 279 | // and call abort() |
| 280 | 280 | |
| 281 | // XXX: Find a nicer way to loop forever | |
| 282 | while (true) {} | |
| 281 | // Here we sleep forever without hammering the CPU by causing a | |
| 282 | // deadlock | |
| 283 | var deadlock = std.Mutex.init(); | |
| 284 | _ = deadlock.acquire(); | |
| 285 | _ = deadlock.acquire(); | |
| 283 | 286 | } |
| 284 | 287 | }, |
| 285 | 288 | 1 => { |