2 Copyright © 1995-2002, The AROS Development Team.
6 #include <proto/exec.h>
7 #include <exec/execbase.h>
8 #include <exec/memory.h>
9 #include <exec/tasks.h>
10 #include <clib/exec_protos.h>
18 #define STACKSIZE 4096
20 static void entry(void)
24 sigbit2
=AllocSignal(-1);
25 Signal(parent
,1<<sigbit1
);
38 Wait(0);/* Let the parent remove me */
41 int main(int argc
, char* argv
[])
45 parent
=SysBase
->ThisTask
;
47 sigbit1
=AllocSignal(-1);
50 t
=(struct Task
*)AllocMem(sizeof(struct Task
), MEMF_PUBLIC
|MEMF_CLEAR
);
54 s
=(UBYTE
*)AllocMem(STACKSIZE
, MEMF_PUBLIC
|MEMF_CLEAR
);
57 t
->tc_Node
.ln_Type
=NT_TASK
;
59 t
->tc_Node
.ln_Name
="new task";
61 t
->tc_SPUpper
=s
+STACKSIZE
;
62 #if AROS_STACK_GROWS_DOWNWARDS
63 t
->tc_SPReg
=(UBYTE
*)t
->tc_SPUpper
-SP_OFFSET
;
65 t
->tc_SPReg
=(UBYTE
*)t
->tc_SPLower
-SP_OFFSET
;
67 NEWLIST(&t
->tc_MemEntry
);
68 AddTask(t
,&entry
,NULL
);
70 printf("%p %p %p %p\n",t
,FindTask("new task"),
71 SysBase
->ThisTask
,FindTask(NULL
));
85 FreeMem(t
,sizeof(struct Task
));