From e043976466544aff0f21ae2e71069b7220063c56 Mon Sep 17 00:00:00 2001 From: NeGate Date: Wed, 29 Jun 2022 03:27:50 -0400 Subject: [PATCH] Added timedout as return on thrd_join --- src/win/win_threads.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/win/win_threads.c b/src/win/win_threads.c index 3944e05..720e920 100644 --- a/src/win/win_threads.c +++ b/src/win/win_threads.c @@ -52,8 +52,11 @@ int thrd_equal(thrd_t thr0, thrd_t thr1) { } int thrd_join(thrd_t thr, int *res) { - if (WaitForSingleObject(thr.handle, INFINITE) == WAIT_FAILED) { + DWORD wait = WaitForSingleObject(thr.handle, INFINITE); + if (wait == WAIT_FAILED) { return thrd_error; + } else if (wait == WAIT_TIMEOUT) { + return thrd_timedout; } if (res != NULL) {