Commit 2501e80500

LemonBoy <thatlemon@gmail.com>
2020-03-13 19:20:18
Even better idle waiting method
1 parent e496ef2
Changed files (1)
lib
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 => {