From: hbirr@svn.reactos.com
- Prevent from calling PsTerminateCurrentThread from within
an apc if PsTerminateThread was already called.
This change prevents terminating a thread from another thread. In that case, PsTerminateOtherThread() is called, which sets up an APC and sets Thread->HasTerminated to TRUE. This will make PiTerminateThreadNormalRoutine() skip the call to PsTerminateCurrentThread().
A side effect is that a multi-threaded app will not exit on an ExitProcess() call. The thread calling ExitProcess() will terminate, but the other threads will happily continue running. This is the reason GUI console windows don't close anymore when you click their close button.
Gé van Geldorp.