Re: Closing a thread that is waiting for Irq



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
>>
>
>


.



Relevant Pages

  • Closing a thread that is waiting for Irq
    ... In a stream device driver a measuring thread starts when the application ... which comes from hardware interrupt (created with ... The timeout time is a few seconds. ... flag that the thread reads after WaitForSingleObject returns. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: How Can I handle more than one interrupt in a device driver?
    ... Did you change to WaitForSingleObject in the two threads? ... beitman AT applieddata DOT net ... Now I must handle with two external interrupt in a device driver. ... I also create two ISTs for each interrupt, but sill fails. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Closing a thread that is waiting for Irq
    ... from an IRQ. ... > ) which comes from hardware interrupt (created with ... The timeout time is a few seconds. ... > flag that the thread reads after WaitForSingleObject returns. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Closing a thread that is waiting for Irq
    ... > In a stream device driver a measuring thread starts when the application ... > ) which comes from hardware interrupt (created with ... The timeout time is a few seconds. ... > flag that the thread reads after WaitForSingleObject returns. ...
    (microsoft.public.windowsce.platbuilder)
  • [Fwd: 2.6.20-14.23 pauses on ThinkPad X32]
    ... Latency: 96 ... Subsystem: 1014:052d ... Interrupt: pin A routed to IRQ 11 ...
    (Ubuntu)