PKPRCB Prcb = KeGetCurrentPrcb();
PKTHREAD OldThread, NewThread;
- /* Initialize the idle loop: disable interrupts */
- _enable();
- YieldProcessor();
- YieldProcessor();
- _disable();
-
/* Now loop forever */
while (TRUE)
{
+ /* Start of the idle loop: disable interrupts */
+ _enable();
+ YieldProcessor();
+ YieldProcessor();
+ _disable();
+
/* Check for pending timers, pending DPCs, or pending ready threads */
if ((Prcb->DpcData[0].DpcQueueDepth) ||
(Prcb->TimerRequest) ||
/* Switch away from the idle thread */
KiSwapContext(APC_LEVEL, OldThread);
-
- /* We are back in the idle thread -- disable interrupts again */
- _enable();
- YieldProcessor();
- YieldProcessor();
- _disable();
}
else
{