Eggtimer-0.9.1 thread won't end

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 24 Mar 2006 Peter Juszack <vdr@xxxxxxxxxxxxxxx> wrote:

> Do I have to lock/unlock the cDevice when switching to a channel?

I don't know this specific plugin, but looking at the code
sniplet:

> void cEggtimerThread::Stop(void) {
> #ifdef DEBUG
>         printf("cEggtimerThread::Stop\n" );
> #endif
>         running = false;
>         Cancel(30);
> }
> 
> 
> void cEggtimerThread::Action(void) {

[...]

> 
>                     Stop(); // Stop eggtimer thread

I don't think that one should Cancel() (in this case via Stop())
a thread from inside the Action() function.
This must lead to the observed dead-lock.

I guess you should set running=false and let the loop terminate
itself (if needed you can break; out from the loop too). On exit
from Action() the child thread is terminated.

Regards.

-- 
Stefan Huelswitt
s.huelswitt@xxxxxx  | http://www.muempf.de/


[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux