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:

> I know that it would be possible to leave the Action mehtod via return. 
> But I want
> to implement some clean up at after the action loop so the method must 
> finish
> in al cases.

In that case you could leave the action loop with break.
No need for another flag normaly.

> I don't understand why it is not possible to set the cThread::running 
> member to false
> from within the action loop or use any other cThread implemented 
> mechnism to leave
> the action loop.
> Leaving this to the plugin developer is not the best idea beacause of 
> duplicate running variables.

Well, I don't see the problem.

If you want to stop a thread from outside i.e. from another
thread you use Cancel(), as this envolves signaling the running
thread that it should shut down.

If you're on the thread i.e. inside Action() there is no need for
any kind of signaling, you must only drop out of the Action()
function to shut down the thread.

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