Fixed thread implementation for win32

This commit is contained in:
Michael Jumper 2011-04-21 23:48:44 -07:00
parent 9d8594fb7e
commit 3239f032ae
2 changed files with 3 additions and 3 deletions

View File

@ -53,7 +53,7 @@ typedef pthread_t guac_thread_t;
#include <windows.h>
#include <process.h>
typedef uintptr_t guac_thread_t;
typedef HANDLE guac_thread_t;
#endif

View File

@ -48,7 +48,7 @@ int guac_thread_create(guac_thread_t* thread, void*(*function)(void*), void* dat
#ifdef HAVE_LIBPTHREAD
return pthread_create(thread, NULL, function, data);
#elif defined(__MINGW32__)
*thread = _beginthreadex(NULL, 0,
*thread = (guac_thread_t) _beginthreadex(NULL, 0,
(unsigned(__stdcall*)(void*)) function, data,
0 /* Create running */, NULL);
if (thread == 0)
@ -61,7 +61,7 @@ void guac_thread_join(guac_thread_t thread) {
#ifdef HAVE_LIBPTHREAD
pthread_join(thread, NULL);
#elif defined(__MINGW32__)
WaitForSingleObject(&thread, INFINITE);
WaitForSingleObject(thread, INFINITE);
#endif
}