-typedef struct sMessage {
- struct sMessage *Next;
- Uint Source;
- Uint Length;
- Uint8 Data[];
-} tMsg; // sizeof = 12+
-
-typedef struct sThread {
- struct sThread *Next;
- int IsLocked;
- int Status; //!< Thread Status
-
- Uint TID; //!< Thread ID
- Uint TGID; //!< Thread Group (Process)
- Uint UID, GID; //!< User and Group
- char *ThreadName; //!< Name of thread
-
- Uint ESP, EBP, EIP; //!< State on switch
- #if USE_PAE
- Uint64 PML4[3]; //!< Address Space
- #else
- Uint CR3; //!< Memory Space
- #endif
-
- Uint KernelStack; //!< Thread's Kernel Stack
-
- tMsg *Messages; //!< Message Queue
- tMsg *LastMessage; //!< Last Message (speeds up insertion)
-
- int Quantum, Remaining; //!< Quantum Size and remaining timesteps
- int NumTickets; //!< Priority - Chance of gaining CPU
-
- Uint Config[NUM_CFG_ENTRIES]; //!< Per-process configuration
-} tThread; // sizeof = 68
-
-enum {
- THREAD_STAT_NULL,
- THREAD_STAT_ACTIVE,
- THREAD_STAT_SLEEPING,
- THREAD_STAT_WAITING,
- THREAD_STAT_DEAD
-};