1 #include <proto/exec.h>
7 static LONG slot1
, slot2
, slot3
;
9 static void printslot1(void)
11 FPrintf(out
, "Value slot %ld: %ld\n", slot1
, GetTaskStorageSlot(slot1
));
18 slot1
= AllocTaskStorageSlot();
19 FPrintf(out
, "Got slot %ld\n", slot1
);
21 slot2
= AllocTaskStorageSlot();
22 FPrintf(out
, "Got slot %ld\n", slot2
);
24 FreeTaskStorageSlot(slot2
);
25 FPrintf(out
, "Freed slot %ld\n", slot2
);
27 slot2
= AllocTaskStorageSlot();
28 FPrintf(out
, "Got slot %ld\n", slot2
);
30 slot3
= AllocTaskStorageSlot();
31 FPrintf(out
, "Got slot %ld\n", slot3
);
33 SetTaskStorageSlot(slot1
, 69);
34 FPrintf(out
, "Stored value 69 in slot %ld\n", slot1
);
36 FPrintf(out
, "Checking value in subtask\n");
37 struct Process
*proc
=
39 NP_Entry
, printslot1
, NP_Name
, "Check slot1",
40 NP_Synchronous
, TRUE
, TAG_DONE
44 FreeTaskStorageSlot(slot1
);
45 FPrintf(out
, "Freed slot %ld\n", slot1
);
47 slot1
= AllocTaskStorageSlot();
48 FPrintf(out
, "Got slot %ld\n", slot1
);
50 FreeTaskStorageSlot(slot2
);
51 FPrintf(out
, "Freed slot %ld\n", slot2
);
53 FreeTaskStorageSlot(slot1
);
54 FPrintf(out
, "Freed slot %ld\n", slot1
);
56 FreeTaskStorageSlot(slot3
);
57 FPrintf(out
, "Freed slot %ld\n", slot3
);