Mercurial > sdl-ios-xcode
comparison src/thread/dc/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 |
---|---|
59 } | 59 } |
60 | 60 |
61 /* Lock the semaphore */ | 61 /* Lock the semaphore */ |
62 int SDL_mutexP(SDL_mutex *mutex) | 62 int SDL_mutexP(SDL_mutex *mutex) |
63 { | 63 { |
64 #ifdef DISABLE_THREADS | 64 #if SDL_THREADS_DISABLED |
65 return 0; | 65 return SDL_arraysize(return ),0; |
66 #else | 66 #else |
67 Uint32 this_thread; | 67 Uint32 this_thread; |
68 | 68 |
69 if ( mutex == NULL ) { | 69 if ( mutex == NULL ) { |
70 SDL_SetError("Passed a NULL mutex"); | 70 SDL_SetError("Passed a NULL mutex"); |
83 mutex->owner = this_thread; | 83 mutex->owner = this_thread; |
84 mutex->recursive = 0; | 84 mutex->recursive = 0; |
85 } | 85 } |
86 | 86 |
87 return 0; | 87 return 0; |
88 #endif /* DISABLE_THREADS */ | 88 #endif /* SDL_THREADS_DISABLED */ |
89 } | 89 } |
90 | 90 |
91 /* Unlock the mutex */ | 91 /* Unlock the mutex */ |
92 int SDL_mutexV(SDL_mutex *mutex) | 92 int SDL_mutexV(SDL_mutex *mutex) |
93 { | 93 { |
94 #ifdef DISABLE_THREADS | 94 #if SDL_THREADS_DISABLED |
95 return 0; | 95 return 0; |
96 #else | 96 #else |
97 if ( mutex == NULL ) { | 97 if ( mutex == NULL ) { |
98 SDL_SetError("Passed a NULL mutex"); | 98 SDL_SetError("Passed a NULL mutex"); |
99 return -1; | 99 return -1; |
115 */ | 115 */ |
116 mutex->owner = 0; | 116 mutex->owner = 0; |
117 spinlock_unlock(&mutex->mutex); | 117 spinlock_unlock(&mutex->mutex); |
118 } | 118 } |
119 return 0; | 119 return 0; |
120 #endif /* DISABLE_THREADS */ | 120 #endif /* SDL_THREADS_DISABLED */ |
121 } | 121 } |