comparison src/thread/linux/SDL_sysmutex.c @ 1338:604d73db6802

Removed uses of stdlib.h and string.h
author Sam Lantinga <slouken@libsdl.org>
date Tue, 07 Feb 2006 09:29:18 +0000
parents 3692456e7b0f
children c71e05b4dc2e
comparison
equal deleted inserted replaced
1337:c687f06c7473 1338:604d73db6802
35 #endif /* glibc 2.0 */ 35 #endif /* glibc 2.0 */
36 #endif /* linux */ 36 #endif /* linux */
37 37
38 #ifdef SDL_USE_PTHREADS 38 #ifdef SDL_USE_PTHREADS
39 39
40 #include <stdlib.h>
41 #include <stdio.h>
42 #include <pthread.h> 40 #include <pthread.h>
43 41
42 #include "SDL_stdlib.h"
44 #include "SDL_error.h" 43 #include "SDL_error.h"
45 #include "SDL_thread.h" 44 #include "SDL_thread.h"
46 45
47 46
48 struct SDL_mutex { 47 struct SDL_mutex {
57 { 56 {
58 SDL_mutex *mutex; 57 SDL_mutex *mutex;
59 pthread_mutexattr_t attr; 58 pthread_mutexattr_t attr;
60 59
61 /* Allocate the structure */ 60 /* Allocate the structure */
62 mutex = (SDL_mutex *)calloc(1, sizeof(*mutex)); 61 mutex = (SDL_mutex *)SDL_calloc(1, sizeof(*mutex));
63 if ( mutex ) { 62 if ( mutex ) {
64 pthread_mutexattr_init(&attr); 63 pthread_mutexattr_init(&attr);
65 #if defined(PTHREAD_RECURSIVE_MUTEX) 64 #if defined(PTHREAD_RECURSIVE_MUTEX)
66 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); 65 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
67 #elif defined(PTHREAD_RECURSIVE_MUTEX_NP) 66 #elif defined(PTHREAD_RECURSIVE_MUTEX_NP)