Re: Closing a thread that is waiting for Irq



Call CloseHandle() on the event. This will cause WaitForSingleObject
to return WAIT_FAILED immedeately.


"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: Closing a thread that is waiting for Irq
    ... This will not work because interrupt events can not be used ... >from an IRQ. ... 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
    ... 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: 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)