updateHook still running after stop.

Hello.

I don't see the diference between breakUpdateHook and stop.

In RTT 1.X, for my nonperiodic tasks, i used to implement the updateHook breaking in breakUpdateHook.

In RTT 2.X, when i call stop on my component, the updateHook still run after stop.

It seems that in 1.X, the TaskCore::stop() call the ExecutionEngine::stop(), that lead to call the Thread::stop() that call breakUpdateHook().

In 2.X, the TaskCore::stop() only call the stopHook().

So my question are :

(1) in RTT 2.x, what stopHook is supposed to do ? Stop updateHook thread ? Only set a flag that tell the updateHook thread to do nothing ?
(2) Iif we are supposed to be able to stop the thread within the stopHook, is breakUpdateHook still usefull ?

Thank for your help.

Paul.

P.S. I join a piece of code that reproduce the case : just do "deployer-gnulinux -s deployment.xml Test", then "quit".

AttachmentSize
bug_update_after_stop.tar.bz21.22 KB

updateHook still running after stop.

On Tuesday 16 November 2010 14:40:10 paul [dot] chavent [..] ... wrote:
> Hello.
>
> I don't see the diference between breakUpdateHook and stop.
>
> In RTT 1.X, for my nonperiodic tasks, i used to implement the updateHook
> breaking in breakUpdateHook.
>
> In RTT 2.X, when i call stop on my component, the updateHook still run
> after stop.
>
> It seems that in 1.X, the TaskCore::stop() call the
> ExecutionEngine::stop(), that lead to call the Thread::stop() that call
> breakUpdateHook().
>
> In 2.X, the TaskCore::stop() only call the stopHook().
>
> So my question are :
>
> (1) in RTT 2.x, what stopHook is supposed to do ? Stop updateHook thread ?
> Only set a flag that tell the updateHook thread to do nothing ? (2) Iif we
> are supposed to be able to stop the thread within the stopHook, is
> breakUpdateHook still usefull ?

The 2.x behaviour should be the same as 1.x. I have added a unit test and
fixed it on the master branch (gitorious). When updateHook() blocks, and your
task is non periodic, breakUpdateHook() is called during a stop() (and before
stopHook()). When breakUpdateHook() returns true, the thread will wait for
updateHook() to return and then call stopHook(). When breakUpdateHook()
returns false, the stop() fails. Just like in 1.x

Peter

updateHook still running after stop.

On Tuesday 16 November 2010 14:40:10 paul [dot] chavent [..] ... wrote:
> Hello.
>
> I don't see the diference between breakUpdateHook and stop.
>
> In RTT 1.X, for my nonperiodic tasks, i used to implement the updateHook
> breaking in breakUpdateHook.
>
> In RTT 2.X, when i call stop on my component, the updateHook still run
> after stop.
>
> It seems that in 1.X, the TaskCore::stop() call the
> ExecutionEngine::stop(), that lead to call the Thread::stop() that call
> breakUpdateHook().
>
> In 2.X, the TaskCore::stop() only call the stopHook().
>
> So my question are :
>
> (1) in RTT 2.x, what stopHook is supposed to do ? Stop updateHook thread ?
> Only set a flag that tell the updateHook thread to do nothing ? (2) Iif we
> are supposed to be able to stop the thread within the stopHook, is
> breakUpdateHook still usefull ?
>
> Thank for your help.
>
> Paul.
>
> P.S. I join a piece of code that reproduce the case : just do
> "deployer-gnulinux -s deployment.xml Test", then "quit".

Yep, breakUpdateHook() is broken too. I'll try to fix it asap on master.

Peter