Alex Ionescu wrote:
Hartmut Birr wrote:
Hi,
this piece of code is wrong. If we terminating a thread, which waits on something, we do unblock the thread. The thread must check, if it got the lock, if not it must wait again.
- Hartmut
Hi,
Forgot to add in my previous email. You can't terminate a thread that's running at APC_LEVEL because the kill APC won't execute. Hence, it's impossible for the scenario you mentionned to occur.
Best regards, Alex Ionescu
The thread does wait at passive level. It has called ExEnterCriticalRegionAndAcquireFastMutexUnsafe. A other thread tries to terminate the waiting thread. KiInsertQueueApc does unwait the waiting thread, because the exit APC is a special APC.
- Hartmut