typedef struct { int32_t cdecl (*proc)(void *par); void *user_stack; uint32_t stacksize; int16_t mode; int32_t res1; } THREADINFO;
Note: If the component user_stack is NULL, then the system will create the stack itself. When the thread terminates, the system will release the stack again automatically. The component stacksize must always be specified so that the system can set the stack pointer of the thread to the end of the stack. The supervisior-stack is set by the operating system, so that its size cannot be influenced.
The components mode and res1 are reserved for future purposes, so they should be set to the value 0 or 0L. In Solaris 2.x, for instance, one can arrest the thread up to the final start with them. The started thread executes the function proc, which is passed as a parameter to the component par (on the stack). The CPU registers d0-d2 and a0-a2 may be altered by the function.
See also: Threads in MagiC shel_write Sample code