- system_inshutdown = 1;
-
- funnel_state = thread_funnel_set(kernel_flock, TRUE);
-
- /*
- * Temporary hack to notify the power management root domain
- * that the system will shut down.
- */
+ if (!OSCompareAndSwap(0, 1, &system_inshutdown)) {
+ if ( (howto&RB_QUICK) == RB_QUICK)
+ goto force_reboot;
+ return (EBUSY);
+ }
+ /*
+ * Temporary hack to notify the power management root domain
+ * that the system will shut down.
+ */