Page 1 of 1

Stopping a Task from within the same Task.

PostPosted: Wed Jan 02, 2008 5:21 am
by aek
Greg.

You're on MSP430, right?

Update to the latest Salvo release and use OSDestroyTask() -- look at it in the source code and you'll see the new version kills a task completely. Also has a new syntax.

------------------


Re: Stopping a Task from within the same Task.

PostPosted: Wed Jan 02, 2008 7:10 am
by gcarrelli
Question: Can OSStopTask () be called from within the Task that is to be stopped or must it be done outside of that same Task?

Thanks.


Re: Stopping a Task from within the same Task.

PostPosted: Wed Jan 02, 2008 7:14 am
by aek
OS_Stop() is preferred.

Calling OSStopTask() "on itself" will only result in a stopped task if the first context switch to follow the OSStopTask() call is OS_Yield().

------------------


Re: Stopping a Task from within the same Task.

PostPosted: Wed Jan 02, 2008 8:44 am
by gcarrelli
I thought there was an issue with OSStop OSStopTask and you created a new one that unconditionally stopped the specified Task - that is the one I'm actually using - but it seems to not be affective like you said.
I need a definite STOP Task servive - unconditional - I can add OS_Yield in with the stop service if required....
Thanks.

Re: Stopping a Task from within the same Task.

PostPosted: Thu Jan 03, 2008 9:14 am
by gcarrelli
- Yes MSP430.
- I'm getting a better understanding of Stopping & Starting Tasks now. I think part of my problem was handeling Tasks based on OS_Delay( )- such as a timeout Task I made.
- It wasn't stopping when I used OSStopTask -after the OS_Delay time period - but I believe now that this was due to the lack (missing) OS_Yield () that is part of OS_Stop ().
Thanks.