From 5abefaed0a21b1c97decdf6a40d582a0ac41a3ed Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 17 Apr 2014 21:01:54 -0700 Subject: Use the thread ID for althrd_t on Windows --- OpenAL32/Include/threads.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'OpenAL32/Include/threads.h') diff --git a/OpenAL32/Include/threads.h b/OpenAL32/Include/threads.h index 1d9f7640..eade2406 100644 --- a/OpenAL32/Include/threads.h +++ b/OpenAL32/Include/threads.h @@ -29,7 +29,7 @@ typedef void (*altss_dtor_t)(void*); #define WIN32_LEAN_AND_MEAN #include -typedef HANDLE althrd_t; +typedef DWORD althrd_t; typedef CRITICAL_SECTION almtx_t; typedef DWORD altss_t; @@ -46,16 +46,12 @@ int althrd_sleep(const struct timespec *ts, struct timespec *rem); inline althrd_t althrd_current(void) { - /* This is wrong. GetCurrentThread() returns a psuedo-handle of -1 which - * various functions will interpret as the calling thread. There is no - * apparent way to retrieve the same handle that was returned by - * CreateThread. */ - return GetCurrentThread(); + return GetCurrentThreadId(); } inline int althrd_equal(althrd_t thr0, althrd_t thr1) { - return GetThreadId(thr0) == GetThreadId(thr1); + return thr0 == thr1; } inline void althrd_exit(int res) -- cgit v1.2.3