comparison src/thread/generic/SDL_sysmutex.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 99210400e8b9
children f7b03b6838cb
comparison
equal deleted inserted replaced
3577:72024425b437 3578:0d1b16ee0bca
28 28
29 29
30 struct SDL_mutex 30 struct SDL_mutex
31 { 31 {
32 int recursive; 32 int recursive;
33 Uint32 owner; 33 SDL_threadID owner;
34 SDL_sem *sem; 34 SDL_sem *sem;
35 }; 35 };
36 36
37 /* Create a mutex */ 37 /* Create a mutex */
38 SDL_mutex * 38 SDL_mutex *
74 SDL_mutexP(SDL_mutex * mutex) 74 SDL_mutexP(SDL_mutex * mutex)
75 { 75 {
76 #if SDL_THREADS_DISABLED 76 #if SDL_THREADS_DISABLED
77 return 0; 77 return 0;
78 #else 78 #else
79 Uint32 this_thread; 79 SDL_threadID this_thread;
80 80
81 if (mutex == NULL) { 81 if (mutex == NULL) {
82 SDL_SetError("Passed a NULL mutex"); 82 SDL_SetError("Passed a NULL mutex");
83 return -1; 83 return -1;
84 } 84 }