/* FUNCTIONS *****************************************************************/
-VOID
+BOOLEAN
inline
FASTCALL
KiCheckAlertability(BOOLEAN Alertable,
CurrentThread->Alerted[(int)WaitMode] = FALSE;
DPRINT("Thread was Alerted\n");
*Status = STATUS_ALERTED;
+ return TRUE;
/* If there are User APCs Pending, then we can't really be alertable */
} else if ((!IsListEmpty(&CurrentThread->ApcState.ApcListHead[UserMode])) &&
DPRINT("APCs are Pending\n");
CurrentThread->ApcState.UserApcPending = TRUE;
*Status = STATUS_USER_APC;
+ return TRUE;
}
/* If there are User APCs Pending and we are waiting in usermode, then we must notify the caller */
} else if ((CurrentThread->ApcState.UserApcPending) && (WaitMode != KernelMode)) {
DPRINT("APCs are Pending\n");
*Status = STATUS_USER_APC;
+ return TRUE;
}
+
+ return FALSE;
}
/*
do {
/* We are going to wait no matter what (that's the point), so test Alertability */
- KiCheckAlertability(Alertable, CurrentThread, KernelMode, &Status);
+ if (KiCheckAlertability(Alertable, CurrentThread, KernelMode, &Status))
+ break;
/* Set Timer */
ThreadTimer = &CurrentThread->Timer;
WaitBlock->NextWaitBlock = WaitBlock;
/* Make sure we can satisfy the Alertable request */
- KiCheckAlertability(Alertable, CurrentThread, WaitMode, &Status);
+ if (KiCheckAlertability(Alertable, CurrentThread, WaitMode, &Status))
+ break;
/* Set the Wait Status */
CurrentThread->WaitStatus = Status;
}
/* Make sure we can satisfy the Alertable request */
- KiCheckAlertability(Alertable, CurrentThread, WaitMode, &Status);
+ if (KiCheckAlertability(Alertable, CurrentThread, WaitMode, &Status))
+ break;
/* Set the Wait Status */
CurrentThread->WaitStatus = Status;