2 Copyright © 2014-2015, The AROS Development Team. All rights reserved.
6 #include <aros/debug.h>
8 #include "taskstorage.h"
10 /*****************************************************************************
13 #include <proto/exec.h>
15 AROS_LH1(IPTR
, GetParentTaskStorageSlot
,
18 AROS_LHA(LONG
, id
, D0
),
19 struct ExecBase
*, SysBase
, 186, Exec
)
22 Get a value for a task storage slot of parent task.
25 id - slot ID returned from AllocTaskStorageSlot().
28 Value stored by SetTaskStorageSlot() on parent task, or
29 (IPTR)NULL if the slot was never used.
32 Since you are accessing value of another task, the value
33 might be invalid/freed by the time this function returns.
34 To be sure value is still valid, call this function under
42 AllocTaskStorageSlot(), FreeTaskStorageSlot(), SetTaskStorageSlot(),
47 ******************************************************************************/
51 struct Task
*ThisTask
= GET_THIS_TASK
;
52 struct ETask
*et
= ThisTask
? GetETask(ThisTask
) : NULL
;
53 IPTR result
= (IPTR
)NULL
;
58 Forbid(); /* Accessing other task's et_TaskStorage */
61 result
= TaskGetStorageSlot(et
->et_Parent
, id
);