diff include/SDL_thread.h @ 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 d3baf5ac4e37
children f7b03b6838cb
line wrap: on
line diff
--- a/include/SDL_thread.h	Wed Dec 16 03:02:31 2009 +0000
+++ b/include/SDL_thread.h	Wed Dec 16 04:48:11 2009 +0000
@@ -47,6 +47,9 @@
 struct SDL_Thread;
 typedef struct SDL_Thread SDL_Thread;
 
+/* The SDL thread ID */
+typedef unsigned long SDL_threadID;
+
 #if defined(__WIN32__) && !defined(HAVE_LIBC)
 /**
  *  \file SDL_thread.h
@@ -127,16 +130,16 @@
 #endif
 
 /**
- *  Get the 32-bit thread identifier for the current thread.
+ *  Get the thread identifier for the current thread.
  */
-extern DECLSPEC Uint32 SDLCALL SDL_ThreadID(void);
+extern DECLSPEC SDL_threadID SDLCALL SDL_ThreadID(void);
 
 /**
- *  Get the 32-bit thread identifier for the specified thread.
+ *  Get the thread identifier for the specified thread.
  *  
  *  Equivalent to SDL_ThreadID() if the specified thread is NULL.
  */
-extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread * thread);
+extern DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread * thread);
 
 /**
  *  Wait for a thread to finish.