From 3239f032ae5a4a02747e420f97a25be8e27fecd8 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 21 Apr 2011 23:48:44 -0700 Subject: [PATCH] Fixed thread implementation for win32 --- libguac/include/thread.h | 2 +- libguac/src/thread.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libguac/include/thread.h b/libguac/include/thread.h index ae537b1f..33bd5d5d 100644 --- a/libguac/include/thread.h +++ b/libguac/include/thread.h @@ -53,7 +53,7 @@ typedef pthread_t guac_thread_t; #include #include -typedef uintptr_t guac_thread_t; +typedef HANDLE guac_thread_t; #endif diff --git a/libguac/src/thread.c b/libguac/src/thread.c index d8a0db79..cacc7b08 100644 --- a/libguac/src/thread.c +++ b/libguac/src/thread.c @@ -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 }