From 04e63c2a022c9366a41d962ec4bf51a245d55c30 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Tue, 11 Aug 2020 16:03:07 -0400 Subject: [PATCH] chore: panic on recursive softint disables --- runtime/include/software_interrupt.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/runtime/include/software_interrupt.h b/runtime/include/software_interrupt.h index a49cd86..49c93a7 100644 --- a/runtime/include/software_interrupt.h +++ b/runtime/include/software_interrupt.h @@ -26,8 +26,9 @@ extern uint64_t software_interrupt_interval_duration_in_cy static inline void software_interrupt_disable(void) { - while (__sync_bool_compare_and_swap(&software_interrupt_is_disabled, 0, 1) == false) - ; + if (__sync_bool_compare_and_swap(&software_interrupt_is_disabled, 0, 1) == false) { + panic("Recursive call to software_interrupt_disable\n"); + } }