* \brief Core threading structure
*
*/
-typedef struct sThread
+struct sThread
{
// --- threads.c's
/**
volatile int CurCPU;
int bInstrTrace;
-} tThread;
+
+ // --- event.c
+ Uint32 EventState;
+};
enum {
THREAD_STAT_SLEEPING, // Message Sleep
THREAD_STAT_MUTEXSLEEP, // Mutex Sleep
THREAD_STAT_SEMAPHORESLEEP, // Semaphore Sleep
+ THREAD_STAT_QUEUESLEEP, // Queue
+ THREAD_STAT_EVENTSLEEP, // Event sleep
THREAD_STAT_WAITING, // ??? (Waiting for a thread)
THREAD_STAT_PREINIT, // Being created
THREAD_STAT_ZOMBIE, // Died/Killed, but parent not informed
"THREAD_STAT_SLEEPING",
"THREAD_STAT_MUTEXSLEEP",
"THREAD_STAT_SEMAPHORESLEEP",
+ "THREAD_STAT_QUEUESLEEP",
+ "THREAD_STAT_EVENTSLEEP",
"THREAD_STAT_WAITING",
"THREAD_STAT_PREINIT",
"THREAD_STAT_ZOMBIE",
// === GLOBALS ===
extern BOOL gaThreads_NoTaskSwitch[MAX_CPUS];
+extern tShortSpinlock glThreadListLock;
// === FUNCTIONS ===
extern tThread *Proc_GetCurThread(void);
extern void Threads_Kill(tThread *Thread, int Status);
extern void Threads_AddActive(tThread *Thread);
extern tThread *Threads_RemActive(void);
+extern void Threads_Delete(tThread *Thread);
extern tThread *Threads_GetNextToRun(int CPU, tThread *Last);
extern tThread *Threads_CloneTCB(Uint Flags);