Fix horrible bug where Queued Threads were treated like Threads on the
Ready list. I was aware of this bug for months and it's fixed in my new
scheduler but now that tinus has seen it happen, I'm comitting the fix
temporarly in trunk.
Modified: trunk/reactos/ntoskrnl/ke/kthread.c
_____
Modified: trunk/reactos/ntoskrnl/ke/kthread.c
--- trunk/reactos/ntoskrnl/ke/kthread.c 2005-05-03 23:18:21 UTC (rev
14965)
+++ trunk/reactos/ntoskrnl/ke/kthread.c 2005-05-03 23:24:26 UTC (rev
14966)
@@ -54,7 +54,7 @@
KEBUGCHECK(0);
}
- InsertTailList(&PriorityListHead[Priority],
&Thread->QueueListEntry);
+ InsertTailList(&PriorityListHead[Priority],
&Thread->WaitListEntry);
PriorityListMask |= (1 << Priority);
}
@@ -63,7 +63,7 @@
KiRemoveFromThreadList(PKTHREAD Thread)
{
ASSERT(Ready == Thread->State);
- RemoveEntryList(&Thread->QueueListEntry);
+ RemoveEntryList(&Thread->WaitListEntry);
if (IsListEmpty(&PriorityListHead[(ULONG)Thread->Priority])) {
PriorityListMask &= ~(1 << Thread->Priority);
@@ -87,7 +87,7 @@
while (current_entry != &PriorityListHead[Priority]) {
- current = CONTAINING_RECORD(current_entry, KTHREAD,
QueueListEntry);
+ current = CONTAINING_RECORD(current_entry, KTHREAD,
WaitListEntry);
if (current->State != Ready) {