Mercurial > sdl-ios-xcode
comparison src/thread/linux/SDL_sysmutex.c @ 1336:3692456e7b0f
Use SDL_ prefixed versions of C library functions.
FIXME:
Change #include <stdlib.h> to #include "SDL_stdlib.h"
Change #include <string.h> to #include "SDL_string.h"
Make sure nothing else broke because of this...
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 07 Feb 2006 06:59:48 +0000 |
parents | 42e95163d553 |
children | 604d73db6802 |
comparison
equal
deleted
inserted
replaced
1335:c39265384763 | 1336:3692456e7b0f |
---|---|
69 #else | 69 #else |
70 /* No extra attributes necessary */ | 70 /* No extra attributes necessary */ |
71 #endif /* PTHREAD_RECURSIVE_MUTEX */ | 71 #endif /* PTHREAD_RECURSIVE_MUTEX */ |
72 if ( pthread_mutex_init(&mutex->id, &attr) != 0 ) { | 72 if ( pthread_mutex_init(&mutex->id, &attr) != 0 ) { |
73 SDL_SetError("pthread_mutex_init() failed"); | 73 SDL_SetError("pthread_mutex_init() failed"); |
74 free(mutex); | 74 SDL_free(mutex); |
75 mutex = NULL; | 75 mutex = NULL; |
76 } | 76 } |
77 } else { | 77 } else { |
78 SDL_OutOfMemory(); | 78 SDL_OutOfMemory(); |
79 } | 79 } |
82 | 82 |
83 void SDL_DestroyMutex(SDL_mutex *mutex) | 83 void SDL_DestroyMutex(SDL_mutex *mutex) |
84 { | 84 { |
85 if ( mutex ) { | 85 if ( mutex ) { |
86 pthread_mutex_destroy(&mutex->id); | 86 pthread_mutex_destroy(&mutex->id); |
87 free(mutex); | 87 SDL_free(mutex); |
88 } | 88 } |
89 } | 89 } |
90 | 90 |
91 /* Lock the mutex */ | 91 /* Lock the mutex */ |
92 int SDL_mutexP(SDL_mutex *mutex) | 92 int SDL_mutexP(SDL_mutex *mutex) |