From 8b8d3d7e5e157c1f63378a1c17a397fc35e5487b Mon Sep 17 00:00:00 2001 From: nickkelsey Date: Sun, 13 Nov 2022 13:42:15 -0700 Subject: [PATCH] 20221113 --- hdhomerun_os_windows.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/hdhomerun_os_windows.c b/hdhomerun_os_windows.c index 063e4d2..bcea114 100644 --- a/hdhomerun_os_windows.c +++ b/hdhomerun_os_windows.c @@ -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) { - while (1) { - DWORD ExitCode = 0; - if (!GetExitCodeThread(tid, &ExitCode)) { - return; - } - if (ExitCode != STILL_ACTIVE) { - CloseHandle(tid); - return; - } - } + WaitForSingleObject(tid, INFINITE); + CloseHandle(tid); } void thread_mutex_init(thread_mutex_t *mutex)