mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 00:01:34 +11:00
Better comments around the panic handler
This commit is contained in:
parent
18b25e242e
commit
642c3c1b79
|
@ -214,11 +214,15 @@ fn panic_implementation(info: &core::panic::PanicInfo) -> ! {
|
|||
loop {}
|
||||
}
|
||||
|
||||
// If we panic during the panic handler, then there isn't much we can do any more. So this code
|
||||
// just infinite loops halting the CPU.
|
||||
fn avoid_double_panic() {
|
||||
static IS_PANICKING: portable_atomic::AtomicBool = portable_atomic::AtomicBool::new(false);
|
||||
|
||||
if IS_PANICKING.load(portable_atomic::Ordering::SeqCst) {
|
||||
// we panicked during the panic handler, so not much we can do here
|
||||
loop {}
|
||||
loop {
|
||||
syscall::halt();
|
||||
}
|
||||
} else {
|
||||
IS_PANICKING.store(true, portable_atomic::Ordering::SeqCst);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue