Page 1 of 1

Correct way to restart waiting tasks?

PostPosted: Thu Sep 30, 2004 3:28 am
by DFx_Tech
Hi,

Now that I'm back running again I've got a question related to restarting tasks.

I have four simple tasks that each wait on a binary semaphore, when signaled they toggle a port bit then use OS_Delay to sleep for 6 seconds and finaly un-toggle the bit before looping to wait on the semaphore again.

Sometimes these tasks will need to be restarted (the device has a global 'cancel' button) so some may be in OS_Delay() some may be waiting on their semaphore etc..

I have seen in the manual that OSDestroyTask() can't be used on a waiting task, so of course I tried it anyway and that resulted in serious wierdness with the tasks randomly 'locking up' as expected.

So, really my question is how can I completely nuke a running task in an unknown state so I can restart it?

Thanks,

Jon


Re: Correct way to restart waiting tasks?

PostPosted: Thu Sep 30, 2004 6:52 am
by aek
Hi Jon.

I will send you an example of a new Salvo function on Friday that completely kills a waiting task, irrespective of its state.

This "new and improved" OSDestroyTask() will also be in the v3.3 release.

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


Re: Correct way to restart waiting tasks?

PostPosted: Sun Jul 02, 2006 4:22 am
by lucicop2001
Hi aek,

Can you explain to me too how to destroy a waiting task, because I have the same problem with my code...

Thank you in advance !

Best regards,
Lucian


Re: Correct way to restart waiting tasks?

PostPosted: Mon Jul 03, 2006 10:27 am
by lucicop2001
Hello Andrew,

Thank you very much for the code you sent me ! It is very helpful. With this occasion I want to thank you again for providing me the chance to work with Salvo, which is great and is helping me very much.

Many thanks and best regards,
Lucian Copat


Re: Correct way to restart waiting tasks?

PostPosted: Wed Sep 27, 2006 10:06 am
by kamyip
quote:
Originally posted by aek:
Hi Jon.

I will send you an example of a new Salvo function on Friday that completely kills a waiting task, irrespective of its state.

This "new and improved" OSDestroyTask() will also be in the v3.3 release.



Hi Andrew,

Can you send me the code as well? I am facing the same problem.

TQ ;-)


Re: Correct way to restart waiting tasks?

PostPosted: Thu Sep 28, 2006 5:35 am
by kamyip
thanks for the prompt response.

two thumbs up .....


Re: Correct way to restart waiting tasks?

PostPosted: Thu Sep 28, 2006 11:29 am
by aek
On its way to you via email ...

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