2 Copyright © 1995-2015, The AROS Development Team. All rights reserved.
5 Desc: Make any children of ThisTask task orphans.
8 #include "exec_intern.h"
10 #include <proto/exec.h>
12 /*****************************************************************************
16 AROS_LH1(ULONG
, ChildOrphan
,
19 AROS_LHA(ULONG
, tid
, D0
),
22 struct ExecBase
*, SysBase
, 124, Exec
)
25 ChildOrphan() will detach the specified task from the its parent
26 task child task tree. This is useful if the parent task will be
27 exiting, and no longer needs to be told about child task events.
29 Note that the default Task finaliser will orphan any remaining
30 children when the task exits. This function can be used if you just
31 do not wish to be told about a particular task.
34 tid -- The ID of the task to orphan, or 0 for all tasks. Note
35 that it is NOT the pointer to the task.
38 Will return 0 on success or CHILD_* on an error.
40 The child/children will no longer participate in child task
53 *****************************************************************************/
57 struct Task
*ThisTask
= GET_THIS_TASK
;
58 struct ETask
*et
, *child
;
60 et
= GetETask(ThisTask
);
67 ForeachNode(&et
->et_Children
, child
)
70 Don't need to Remove(), because I'll blow away the entire
71 list at the end of the loop.
73 child
->et_Parent
= NULL
;
75 NEWLIST(&et
->et_Children
);
81 child
= FindChild(tid
);
84 child
->et_Parent
= NULL
;
85 Remove((struct Node
*)child
);
90 return CHILD_NOTFOUND
;