mirror of
https://github.com/reactos/reactos.git
synced 2025-02-28 19:32:59 +00:00
WIP add a bunch of ASSERTs
This commit is contained in:
parent
bcbc2c8700
commit
8c66cce23c
1 changed files with 10 additions and 0 deletions
|
@ -328,6 +328,7 @@ KiDeferredReadyThread(IN PKTHREAD Thread)
|
|||
{
|
||||
/* Sanity check */
|
||||
ASSERT(NextThread->State == Standby);
|
||||
ASSERT(NextThread != KeGetCurrentThread());
|
||||
|
||||
/* Check if priority changed */
|
||||
if (OldPriority > NextThread->Priority)
|
||||
|
@ -358,6 +359,7 @@ KiDeferredReadyThread(IN PKTHREAD Thread)
|
|||
|
||||
/* Set the thread on standby and as the next thread */
|
||||
Thread->State = Standby;
|
||||
ASSERT(Prcb->NextThread != Thread);
|
||||
Prcb->NextThread = Thread;
|
||||
|
||||
/* Release the lock */
|
||||
|
@ -441,6 +443,9 @@ KiSwapThread(IN PKTHREAD CurrentThread,
|
|||
NextThread = Prcb->NextThread;
|
||||
if (NextThread)
|
||||
{
|
||||
ASSERT(NextThread->State == Standby);
|
||||
ASSERT(NextThread != CurrentThread);
|
||||
|
||||
/* Already got a thread, set it up */
|
||||
Prcb->NextThread = NULL;
|
||||
Prcb->CurrentThread = NextThread;
|
||||
|
@ -452,6 +457,10 @@ KiSwapThread(IN PKTHREAD CurrentThread,
|
|||
NextThread = KiSelectReadyThread(0, Prcb);
|
||||
if (NextThread)
|
||||
{
|
||||
#ifndef CONFIG_SMP
|
||||
ASSERT(NextThread != CurrentThread);
|
||||
#endif
|
||||
|
||||
/* Switch to it */
|
||||
Prcb->CurrentThread = NextThread;
|
||||
NextThread->State = Running;
|
||||
|
@ -463,6 +472,7 @@ KiSwapThread(IN PKTHREAD CurrentThread,
|
|||
|
||||
/* Schedule the idle thread */
|
||||
NextThread = Prcb->IdleThread;
|
||||
ASSERT(NextThread != CurrentThread);
|
||||
Prcb->CurrentThread = NextThread;
|
||||
NextThread->State = Running;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue