comparison src/thread/pth/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 1d74ddc90cb2
children 604d73db6802
comparison
equal deleted inserted replaced
1335:c39265384763 1336:3692456e7b0f
16 SDL_mutex *SDL_CreateMutex(void) 16 SDL_mutex *SDL_CreateMutex(void)
17 { 17 {
18 SDL_mutex *mutex; 18 SDL_mutex *mutex;
19 19
20 /* Allocate mutex memory */ 20 /* Allocate mutex memory */
21 mutex = (SDL_mutex *)malloc(sizeof(*mutex)); 21 mutex = (SDL_mutex *)SDL_malloc(sizeof(*mutex));
22 if ( mutex ) { 22 if ( mutex ) {
23 /* Create the mutex, with initial value signaled */ 23 /* Create the mutex, with initial value signaled */
24 if (!pth_mutex_init(&(mutex->mutexpth_p))) { 24 if (!pth_mutex_init(&(mutex->mutexpth_p))) {
25 SDL_SetError("Couldn't create mutex"); 25 SDL_SetError("Couldn't create mutex");
26 free(mutex); 26 SDL_free(mutex);
27 mutex = NULL; 27 mutex = NULL;
28 } 28 }
29 } else { 29 } else {
30 SDL_OutOfMemory(); 30 SDL_OutOfMemory();
31 } 31 }
34 34
35 /* Free the mutex */ 35 /* Free the mutex */
36 void SDL_DestroyMutex(SDL_mutex *mutex) 36 void SDL_DestroyMutex(SDL_mutex *mutex)
37 { 37 {
38 if ( mutex ) { 38 if ( mutex ) {
39 free(mutex); 39 SDL_free(mutex);
40 } 40 }
41 } 41 }
42 42
43 /* Lock the mutex */ 43 /* Lock the mutex */
44 int SDL_mutexP(SDL_mutex *mutex) 44 int SDL_mutexP(SDL_mutex *mutex)