Amiga.org
Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: jahc on June 22, 2003, 02:14:53 AM
-
I've created a task with CreateNewProcTags() .. I want to be able to terminate it from another task.. is there a way to do this? Without the task ending by itself?
-
RemTask((struct Task *) DaProc);
However, this is very bad idea unless if the running process is in a known state. If the process has allocated some resources, those resources will not be released.
It is always better to signal the process to terminate, that way it can do the cleanup as needed.
-
Never abitrarily remove a thread. You should let it finish via a return from the entry function you used (just as a normal program returns from main).
As piru says, use a signalling policy. When your thread receives the appropriate signal it should finish up and clean up after itself.