comparison src/thread/generic/SDL_sysmutex.c @ 1361:19418e4422cb

New configure-based build system. Still work in progress, but much improved
author Sam Lantinga <slouken@libsdl.org>
date Thu, 16 Feb 2006 10:11:48 +0000
parents c71e05b4dc2e
children d910939febfa
comparison
equal deleted inserted replaced
1360:70a9cfb4cf1b 1361:19418e4422cb
66 } 66 }
67 67
68 /* Lock the semaphore */ 68 /* Lock the semaphore */
69 int SDL_mutexP(SDL_mutex *mutex) 69 int SDL_mutexP(SDL_mutex *mutex)
70 { 70 {
71 #ifdef DISABLE_THREADS 71 #if SDL_THREADS_DISABLED
72 return 0; 72 return 0;
73 #else 73 #else
74 Uint32 this_thread; 74 Uint32 this_thread;
75 75
76 if ( mutex == NULL ) { 76 if ( mutex == NULL ) {
90 mutex->owner = this_thread; 90 mutex->owner = this_thread;
91 mutex->recursive = 0; 91 mutex->recursive = 0;
92 } 92 }
93 93
94 return 0; 94 return 0;
95 #endif /* DISABLE_THREADS */ 95 #endif /* SDL_THREADS_DISABLED */
96 } 96 }
97 97
98 /* Unlock the mutex */ 98 /* Unlock the mutex */
99 int SDL_mutexV(SDL_mutex *mutex) 99 int SDL_mutexV(SDL_mutex *mutex)
100 { 100 {
101 #ifdef DISABLE_THREADS 101 #if SDL_THREADS_DISABLED
102 return 0; 102 return 0;
103 #else 103 #else
104 if ( mutex == NULL ) { 104 if ( mutex == NULL ) {
105 SDL_SetError("Passed a NULL mutex"); 105 SDL_SetError("Passed a NULL mutex");
106 return -1; 106 return -1;
122 */ 122 */
123 mutex->owner = 0; 123 mutex->owner = 0;
124 SDL_SemPost(mutex->sem); 124 SDL_SemPost(mutex->sem);
125 } 125 }
126 return 0; 126 return 0;
127 #endif /* DISABLE_THREADS */ 127 #endif /* SDL_THREADS_DISABLED */
128 } 128 }