- Fix a broken check in PspExitThread. We should check if Stack Swapping is _disabled_ during termination, not crash if it is enabled!

- Fix KeInitThread to respect this, and initialize EnableStackSwap to TRUE. Otherwise, only executive worker threads who modify the stack swap flag themselves encounter this issue.
- This, along with my previous change, fixes worker thread termination being completely broken and crashing ros.
- Thanks to Aleksey for confirming my changes

svn path=/trunk/; revision=35302
This commit is contained in:
Stefan Ginsberg 2008-08-13 09:00:50 +00:00
parent 7d75e41b42
commit 8091f31182
2 changed files with 4 additions and 4 deletions

View file

@ -742,7 +742,7 @@ KeInitThread(IN OUT PKTHREAD Thread,
}
/* Set swap settings */
Thread->EnableStackSwap = FALSE;//TRUE;
Thread->EnableStackSwap = TRUE;
Thread->IdealProcessor = 1;
Thread->SwapBusy = FALSE;
Thread->KernelStackResident = TRUE;

View file

@ -697,10 +697,10 @@ PspExitThread(IN NTSTATUS ExitStatus)
PspW32ProcessCallout(CurrentProcess, FALSE);
}
/* Make sure Stack Swap isn't enabled */
if (Thread->Tcb.EnableStackSwap)
/* Make sure Stack Swap is enabled */
if (!Thread->Tcb.EnableStackSwap)
{
/* Stack swap really shouldn't be on during exit !*/
/* Stack swap really shouldn't be disabled during exit! */
KEBUGCHECKEX(KERNEL_STACK_LOCKED_AT_EXIT, 0, 0, 0, 0);
}