Re: Closing a thread that is waiting for Irq
- From: "Voidcoder" <voidcoder@xxxxxxxxx>
- Date: Wed, 29 Jun 2005 21:44:28 -0700
This will not work because interrupt events can not be used
in WaitFroMultipleObjects call, only WaitForSingleObject.
You will get a DEBUGCHK immediately.
One way is to close event handle from another thread ,
as Charles said.
Another solution may be setting a global variable, a flag,
another event or whatever you want and then signal
interrupt event manually using SetInterruptEvent.
Of course the IST has to check this variable each
interrupt and break execution once the var is set.
"Anthony Pellerin" <apellerin_nospam@xxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:eqnGplHfFHA.272@xxxxxxxxxxxxxxxxxxxxxxx
>I think that you can call waitformultipleobject if no more than 1 event is
>from an IRQ.
> So call it for your IRQ event and for a "STOP" event (which is not from
> an IRQ) and this should work
>
> --
> ----------------------------------------------------------------
> Anthony Pellerin
> ADENEO (ADESET)
> Windows Embedded Consultant
> <apellerin AT adeneo DOT adetelgroup DOT com>
> http://www.adeneo.adetelgroup.com
> Tél : +33 (0)4.72.18.57.77
> Fax : +33 (0)4.72.18.57.78
> ----------------------------------------------------------------
>
>
> "Igge H" <IggeH@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:782083F8-FE2F-43E7-A0F6-96C9FB652C07@xxxxxxxxxxxxxxxx
>> Hello experts,
>> My problem:
>> In a stream device driver a measuring thread starts when the application
>> calls XXX_IOControl with a specific parameter. The tread waits for an
>> event
>> (WaitForSingleObject()) which comes from hardware interrupt (created with
>> InterrruptInitialize). The timeout time is a few seconds.
>>
>> Another call to XXX_IOControl closes the measuring thread down, it sets a
>> flag that the thread reads after WaitForSingleObject returns.
>>
>> The problem is that the thread must close immediately, I do not have time
>> to
>> wait for an WaitForSingleObject to timeout.
>>
>> For what I understand it's not wise to use TerminateThread? It also seems
>> impossible to use WaitForMultipleObjects() when HW Interrupts are
>> involved?
>> Anyone any Ideas?
>> (I use Windows CE 4.2 XSCALE platform)
>> Best regards
>> Igge
>>
>
>
.
- Follow-Ups:
- Re: Closing a thread that is waiting for Irq
- From: Steve Maillet \(eMVP\)
- Re: Closing a thread that is waiting for Irq
- References:
- Closing a thread that is waiting for Irq
- From: Igge H
- Re: Closing a thread that is waiting for Irq
- From: Anthony Pellerin
- Closing a thread that is waiting for Irq
- Prev by Date: Re: How to determine which ceddk api to use
- Next by Date: Re: Is NdisMStartBufferPhysicalMapping a valid function in WinCE
- Previous by thread: Re: Closing a thread that is waiting for Irq
- Next by thread: Re: Closing a thread that is waiting for Irq
- Index(es):
Relevant Pages
|
|