comparison src/thread/nds/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
36 36
37 37
38 struct SDL_mutex 38 struct SDL_mutex
39 { 39 {
40 int recursive; 40 int recursive;
41 Uint32 owner; 41 SDL_threadID owner;
42 SDL_sem *sem; 42 SDL_sem *sem;
43 }; 43 };
44 44
45 /* Create a mutex */ 45 /* Create a mutex */
46 SDL_mutex * 46 SDL_mutex *
82 SDL_mutexP(SDL_mutex * mutex) 82 SDL_mutexP(SDL_mutex * mutex)
83 { 83 {
84 #ifdef DISABLE_THREADS 84 #ifdef DISABLE_THREADS
85 return 0; 85 return 0;
86 #else 86 #else
87 Uint32 this_thread; 87 SDL_threadID this_thread;
88 88
89 if (mutex == NULL) { 89 if (mutex == NULL) {
90 SDL_SetError("Passed a NULL mutex"); 90 SDL_SetError("Passed a NULL mutex");
91 return -1; 91 return -1;
92 } 92 }