13#define OS_THREAD_STATE_UNINITIALIZED 0
14#define OS_THREAD_STATE_READY 1
15#define OS_THREAD_STATE_RUNNING 2
16#define OS_THREAD_STATE_WAITING 4
17#define OS_THREAD_STATE_DEAD 8
19#define OS_THREAD_ATTR_DETACH 0x0001u
21#define OS_THREAD_STACK_MAGIC 0xDEADBABE
23#define OS_PRIORITY_MIN 0
24#define OS_PRIORITY_MAX 31
25#define OS_PRIORITY_IDLE OS_PRIORITY_MAX
BOOL OSIsThreadTerminated(OSThread *thread)
Definition OSThread.c:207
s32 OSResumeThread(OSThread *thread)
Definition OSThread.c:565
void OSWakeupThread(OSThreadQueue *queue)
Definition OSThread.c:643
OSSwitchThreadCallback OSSetSwitchThreadCallback(OSSwitchThreadCallback func)
Definition OSThread.c:96
s32 OSSetThreadPriority(OSThread *thread, s32 priority)
Definition OSThread.c:660
s32 OSCheckActiveThreads(void)
Definition OSThread.c:724
OSThread * OSGetCurrentThread(void)
Definition OSThread.c:202
void __OSReschedule(void)
Definition OSThread.c:407
void OSSleepThread(OSThreadQueue *queue)
Definition OSThread.c:627
void OSCancelThread(OSThread *thread)
Definition OSThread.c:506
void OSYieldThread(void)
Definition OSThread.c:416
s32 OSPriority
Definition OSThread.h:11
static void UnsetRun(OSThread *thread)
void OSDetachThread(OSThread *thread)
Definition OSThread.c:549
void __OSPromoteThread(OSThread *thread, s32 priority)
Definition OSThread.c:322
s32 OSDisableScheduler(void)
Definition OSThread.c:214
static OSThread * SetEffectivePriority(OSThread *thread, s32 priority)
OSThreadQueue OS_THREAD_QUEUE AT_ADDRESS(0x800000DC)
static OSThread * SelectThread(BOOL yield)
void(* OSSwitchThreadCallback)(OSThread *from, OSThread *to)
Definition OSThread.h:76
s32 OSGetThreadPriority(OSThread *thread)
Definition OSThread.c:679
void OSInitThreadQueue(OSThreadQueue *queue)
Definition OSThread.c:196
BOOL OSCreateThread(OSThread *thread, void *func, void *param, void *stackBase, u32 stackSize, s32 priority, u16 attribute)
Definition OSThread.c:425
void __OSThreadInit(void)
Definition OSThread.c:159
s32 OSEnableScheduler(void)
Definition OSThread.c:222
static void DefaultSwitchThreadCallback(OSThread *from, OSThread *to)
static void OSClearStack(u8 value)
Definition OSThread.c:925
s32 OSSuspendThread(OSThread *thread)
Definition OSThread.c:595
u16 OSThreadState
Definition OSThread.h:10
static s32 CheckThreadQueue(OSThreadQueue *thread)
Definition OSThread.c:684
s32 __OSGetEffectivePriority(OSThread *thread)
Definition OSThread.c:268
void OSExitThread(void *exitValue)
Definition OSThread.c:479
T cLib_calcTimer(T *value)
Definition c_lib.h:74
Definition OSContext.h:137
OSMutex * next
Definition OSThread.h:47
OSMutex * prev
Definition OSThread.h:48
OSMutex * tail
Definition OSThread.h:53
OSMutex * head
Definition OSThread.h:52
OSThread * prev
Definition OSThread.h:38
OSThread * next
Definition OSThread.h:37
OSThread * tail
Definition OSThread.h:43
OSThread * head
Definition OSThread.h:42
void * exit_value
Definition OSThread.h:63
OSThreadLink active_threads_link
Definition OSThread.h:69
OSThreadState state
Definition OSThread.h:58
u16 attributes
Definition OSThread.h:59
s32 suspend_count
Definition OSThread.h:60
OSMutex * mutex
Definition OSThread.h:67
u8 * stack_base
Definition OSThread.h:70
s32 effective_priority
Definition OSThread.h:61
u32 base_priority
Definition OSThread.h:62
OSThreadQueue join_queue
Definition OSThread.h:66
u8 * error_code
Definition OSThread.h:72
OSMutexQueue owned_mutexes
Definition OSThread.h:68
u32 * stack_end
Definition OSThread.h:71
OSThreadLink link
Definition OSThread.h:65
OSThreadQueue * queue
Definition OSThread.h:64
void * data[2]
Definition OSThread.h:73
OSContext context
Definition OSThread.h:57
int BOOL
Definition types.h:27
unsigned long u32
Definition types.h:10
unsigned short u16
Definition types.h:9
signed long s32
Definition types.h:6
unsigned char u8
Definition types.h:8