From 46da4fb095f636812143db84c38e851a4afbfbee Mon Sep 17 00:00:00 2001 From: headshot2017 <> Date: Sat, 16 Mar 2024 16:25:37 -0400 Subject: [PATCH] adapt thread API redesign for Switch --- src/Platform_Switch.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Platform_Switch.c b/src/Platform_Switch.c index 124c7aef6..7f80dfae9 100644 --- a/src/Platform_Switch.c +++ b/src/Platform_Switch.c @@ -236,14 +236,12 @@ static void ExecSwitchThread(void* param) { ((Thread_StartFunc)param)(); } -void* Thread_Create(Thread_StartFunc func) { - Thread* thread = (Thread*)Mem_Alloc(1, sizeof(Thread), "thread"); - threadCreate(thread, ExecSwitchThread, (void*)func, NULL, 0x100000, 0x2C, -2); - return thread; -} +void Thread_Run(void** handle, Thread_StartFunc func, int stackSize, const char* name) { + Thread* thread = (Thread*)Mem_Alloc(1, sizeof(Thread), name); + *handle = thread; -void Thread_Start2(void* handle, Thread_StartFunc func) { - threadStart((Thread*)handle); + threadCreate(thread, ExecSwitchThread, (void*)func, NULL, stackSize, 0x2C, -2); + threadStart(thread); } void Thread_Detach(void* handle) { }