diff src/thread/pthread/SDL_systhread.c @ 3578:0d1b16ee0bca

Fixed bug #741 The thread ID is an unsigned long so it can hold pthread_t so people can do naughty things with it. I'm going to be adding additional useful thread API functions, but this should prevent crashes in people's existing code on 64-bit architectures.
author Sam Lantinga <slouken@libsdl.org>
date Wed, 16 Dec 2009 04:48:11 +0000
parents dc1eb82ffdaa
children f7b03b6838cb
line wrap: on
line diff
--- a/src/thread/pthread/SDL_systhread.c	Wed Dec 16 03:02:31 2009 +0000
+++ b/src/thread/pthread/SDL_systhread.c	Wed Dec 16 04:48:11 2009 +0000
@@ -38,7 +38,7 @@
 /* RISC OS needs to know the main thread for
  * it's timer and event processing. */
 int riscos_using_threads = 0;
-Uint32 riscos_main_thread = 0;  /* Thread running events */
+SDL_threadID riscos_main_thread = 0;  /* Thread running events */
 #endif
 
 
@@ -99,11 +99,10 @@
 #endif
 }
 
-/* WARNING:  This may not work for systems with 64-bit pid_t */
-Uint32
+SDL_threadID
 SDL_ThreadID(void)
 {
-    return ((Uint32) pthread_self());
+    return ((SDL_threadID) pthread_self());
 }
 
 void