2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 #include <proto/exec.h>
12 static LONG slot1
, slot2
, slot3
;
14 static void printslot1(void)
16 FPrintf(out
, "Value slot %ld: %ld\n", slot1
, GetTaskStorageSlot(slot1
));
23 slot1
= AllocTaskStorageSlot();
24 FPrintf(out
, "Got slot %ld\n", slot1
);
26 slot2
= AllocTaskStorageSlot();
27 FPrintf(out
, "Got slot %ld\n", slot2
);
29 FreeTaskStorageSlot(slot2
);
30 FPrintf(out
, "Freed slot %ld\n", slot2
);
32 slot2
= AllocTaskStorageSlot();
33 FPrintf(out
, "Got slot %ld\n", slot2
);
35 slot3
= AllocTaskStorageSlot();
36 FPrintf(out
, "Got slot %ld\n", slot3
);
38 SetTaskStorageSlot(slot1
, 69);
39 FPrintf(out
, "Stored value 69 in slot %ld\n", slot1
);
41 FPrintf(out
, "Checking value in subtask\n");
42 struct Process
*proc
=
44 NP_Entry
, printslot1
, NP_Name
, "Check slot1",
45 NP_Synchronous
, TRUE
, TAG_DONE
49 FreeTaskStorageSlot(slot1
);
50 FPrintf(out
, "Freed slot %ld\n", slot1
);
52 slot1
= AllocTaskStorageSlot();
53 FPrintf(out
, "Got slot %ld\n", slot1
);
55 FreeTaskStorageSlot(slot2
);
56 FPrintf(out
, "Freed slot %ld\n", slot2
);
58 FreeTaskStorageSlot(slot1
);
59 FPrintf(out
, "Freed slot %ld\n", slot1
);
61 FreeTaskStorageSlot(slot3
);
62 FPrintf(out
, "Freed slot %ld\n", slot3
);