[ros-dev] RE: [hbirr] 12829: - Prevent from callingPsTerminateCurrentThread from within an apc ifPsTerminateThread was already called.

Ge van Geldorp gvg at reactos.com
Fri Feb 4 01:15:57 CET 2005


> From: hbirr at 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.




More information about the Ros-dev mailing list