This commit is contained in:
The Arrayser 2022-08-30 13:42:44 +02:00 committed by GitHub
parent a77346cc5a
commit cc070b0598
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -41,6 +41,6 @@ void sus_heapFree(void * memroy); // what should this function do, if an error o
// Networking API -- coming soon, cuz idk // Networking API -- coming soon, cuz idk
//Threads //Threads
typedef __attribute__ ((sysv_abi)) int (*sus_threadProc)(void * arg); typedef __attribute__ ((sysv_abi)) void (*sus_threadProc)(void * arg);
sus_Bool sus_threadNew(sus_threadProc proc, void * arg); sus_Bool sus_threadNew(sus_threadProc proc, void * arg);
void sus_threadSleep(unsigned long seconds); void sus_threadSleep(unsigned long seconds);

View File

@ -10,7 +10,8 @@ DWORD WINAPI threadProc(void * tiarg){
struct threadInfo * ti = tiarg; struct threadInfo * ti = tiarg;
struct threadInfo currentTI = {.args = ti->args, .proc = ti->proc}; struct threadInfo currentTI = {.args = ti->args, .proc = ti->proc};
sus_heapFree(ti); sus_heapFree(ti);
return currentTI.proc(currentTI.args); currentTI.proc(currentTI.args);
return 0;
} }
sus_Bool sus_threadNew(sus_threadProc proc, void * arg){ sus_Bool sus_threadNew(sus_threadProc proc, void * arg){