diff --git a/runtime/src/local_runqueue_minheap.c b/runtime/src/local_runqueue_minheap.c index 10b0bc6..045bb3f 100644 --- a/runtime/src/local_runqueue_minheap.c +++ b/runtime/src/local_runqueue_minheap.c @@ -119,8 +119,10 @@ err: void local_runqueue_minheap_preempt(ucontext_t *user_context) { - /* Assumption: Software Interrupts are disabed by caller */ - assert(!software_interrupt_is_enabled()); + assert(user_context != NULL); + + /* Prevent nested preemption */ + software_interrupt_disable(); struct sandbox *current_sandbox = current_sandbox_get(); diff --git a/runtime/src/software_interrupt.c b/runtime/src/software_interrupt.c index 01baabf..fc4c249 100644 --- a/runtime/src/software_interrupt.c +++ b/runtime/src/software_interrupt.c @@ -111,7 +111,6 @@ software_interrupt_handle_signals(int signal_type, siginfo_t *signal_info, void if (current_sandbox->state == SANDBOX_RETURNED) return; /* Preempt */ - software_interrupt_disable(); local_runqueue_preempt(user_context); return;