Do not run thread_pause when shutting down
While shutting down, after threads have exited, outstanding i/o can cause
the cpu to go into runloop again where thread_pause will crash the os
because all thread pointers are now invalid.
@@ -97,6 +97,8 @@ static inline boolean update_timer(void)
static inline void sched_thread_pause(void)
{
+ if (shutting_down)
+ return;
nanos_thread nt = get_current_thread();
if (nt)
apply(nt->pause);
