mirror of
https://github.com/reactos/reactos.git
synced 2025-03-01 03:45:16 +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 */
|
/* Sanity check */
|
||||||
ASSERT(NextThread->State == Standby);
|
ASSERT(NextThread->State == Standby);
|
||||||
|
ASSERT(NextThread != KeGetCurrentThread());
|
||||||
|
|
||||||
/* Check if priority changed */
|
/* Check if priority changed */
|
||||||
if (OldPriority > NextThread->Priority)
|
if (OldPriority > NextThread->Priority)
|
||||||
|
@ -358,6 +359,7 @@ KiDeferredReadyThread(IN PKTHREAD Thread)
|
||||||
|
|
||||||
/* Set the thread on standby and as the next thread */
|
/* Set the thread on standby and as the next thread */
|
||||||
Thread->State = Standby;
|
Thread->State = Standby;
|
||||||
|
ASSERT(Prcb->NextThread != Thread);
|
||||||
Prcb->NextThread = Thread;
|
Prcb->NextThread = Thread;
|
||||||
|
|
||||||
/* Release the lock */
|
/* Release the lock */
|
||||||
|
@ -441,6 +443,9 @@ KiSwapThread(IN PKTHREAD CurrentThread,
|
||||||
NextThread = Prcb->NextThread;
|
NextThread = Prcb->NextThread;
|
||||||
if (NextThread)
|
if (NextThread)
|
||||||
{
|
{
|
||||||
|
ASSERT(NextThread->State == Standby);
|
||||||
|
ASSERT(NextThread != CurrentThread);
|
||||||
|
|
||||||
/* Already got a thread, set it up */
|
/* Already got a thread, set it up */
|
||||||
Prcb->NextThread = NULL;
|
Prcb->NextThread = NULL;
|
||||||
Prcb->CurrentThread = NextThread;
|
Prcb->CurrentThread = NextThread;
|
||||||
|
@ -452,6 +457,10 @@ KiSwapThread(IN PKTHREAD CurrentThread,
|
||||||
NextThread = KiSelectReadyThread(0, Prcb);
|
NextThread = KiSelectReadyThread(0, Prcb);
|
||||||
if (NextThread)
|
if (NextThread)
|
||||||
{
|
{
|
||||||
|
#ifndef CONFIG_SMP
|
||||||
|
ASSERT(NextThread != CurrentThread);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Switch to it */
|
/* Switch to it */
|
||||||
Prcb->CurrentThread = NextThread;
|
Prcb->CurrentThread = NextThread;
|
||||||
NextThread->State = Running;
|
NextThread->State = Running;
|
||||||
|
@ -463,6 +472,7 @@ KiSwapThread(IN PKTHREAD CurrentThread,
|
||||||
|
|
||||||
/* Schedule the idle thread */
|
/* Schedule the idle thread */
|
||||||
NextThread = Prcb->IdleThread;
|
NextThread = Prcb->IdleThread;
|
||||||
|
ASSERT(NextThread != CurrentThread);
|
||||||
Prcb->CurrentThread = NextThread;
|
Prcb->CurrentThread = NextThread;
|
||||||
NextThread->State = Running;
|
NextThread->State = Running;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue