[ros-dev] Re: [ros-diffs] [ion] 19352: - Reimplement Fast Mutex implementation in HAL/NT to be compatible with the real implementation. (Fast Mutex needs to raise IRQL).

Hartmut Birr osexpert at googlemail.com
Sun Nov 20 16:34:04 CET 2005


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


More information about the Ros-dev mailing list