1 #include <proto/exec.h>
7 static int slot1
, slot2
, slot3
;
9 static void printslot1(void)
11 IPTR
*ts
= FindTask(NULL
)->tc_UnionETask
.tc_TaskStorage
;
13 FPrintf(out
, "Value slot %ld: %ld\n", slot1
, (int)ts
[slot1
]);
18 IPTR
*ts
= FindTask(NULL
)->tc_UnionETask
.tc_TaskStorage
;
22 slot1
= AllocTaskStorageSlot();
23 FPrintf(out
, "Got slot %d\n", slot1
);
25 slot2
= AllocTaskStorageSlot();
26 FPrintf(out
, "Got slot %d\n", slot2
);
28 FreeTaskStorageSlot(slot2
);
29 FPrintf(out
, "Freed slot %d\n", slot2
);
31 slot2
= AllocTaskStorageSlot();
32 FPrintf(out
, "Got slot %d\n", slot2
);
34 slot3
= AllocTaskStorageSlot();
35 FPrintf(out
, "Got slot %d\n", slot3
);
38 FPrintf(out
, "Stored value 69 in slot %d\n", slot1
);
40 FPrintf(out
, "Checking value in subtask\n");
41 struct Process
*proc
=
43 NP_Entry
, printslot1
, NP_Name
, "Check slot1",
44 NP_Synchronous
, TRUE
, TAG_DONE
48 FreeTaskStorageSlot(slot1
);
49 FPrintf(out
, "Freed slot %d\n", slot1
);
51 slot1
= AllocTaskStorageSlot();
52 FPrintf(out
, "Got slot %d\n", slot1
);
54 FreeTaskStorageSlot(slot2
);
55 FPrintf(out
, "Freed slot %d\n", slot2
);
57 FreeTaskStorageSlot(slot1
);
58 FPrintf(out
, "Freed slot %d\n", slot1
);
60 FreeTaskStorageSlot(slot3
);
61 FPrintf(out
, "Freed slot %d\n", slot3
);