This commit is contained in:
nickkelsey 2022-11-13 13:42:15 -07:00
commit 8b8d3d7e5e

View file

@ -85,16 +85,8 @@ bool thread_task_create(thread_task_t *tid, thread_task_func_t func, void *arg)
void thread_task_join(thread_task_t tid) void thread_task_join(thread_task_t tid)
{ {
while (1) { WaitForSingleObject(tid, INFINITE);
DWORD ExitCode = 0; CloseHandle(tid);
if (!GetExitCodeThread(tid, &ExitCode)) {
return;
}
if (ExitCode != STILL_ACTIVE) {
CloseHandle(tid);
return;
}
}
} }
void thread_mutex_init(thread_mutex_t *mutex) void thread_mutex_init(thread_mutex_t *mutex)