[vdr] Eggtimer-0.9.1 thread won't end

Stefan Huelswitt s.huelswitt at gmx.de
Fri Mar 24 11:48:21 CET 2006


On 24 Mar 2006 Peter Juszack <vdr at unterbrecher.de> 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 at gmx.de  | http://www.muempf.de/



More information about the vdr mailing list