comparison src/thread/linux/SDL_syscond.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 c9b51268668f
children 604d73db6802
comparison
equal deleted inserted replaced
1335:c39265384763 1336:3692456e7b0f
60 /* Create a condition variable */ 60 /* Create a condition variable */
61 SDL_cond * SDL_CreateCond(void) 61 SDL_cond * SDL_CreateCond(void)
62 { 62 {
63 SDL_cond *cond; 63 SDL_cond *cond;
64 64
65 cond = (SDL_cond *) malloc(sizeof(SDL_cond)); 65 cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond));
66 if ( cond ) { 66 if ( cond ) {
67 if ( pthread_cond_init(&cond->cond, NULL) < 0 ) { 67 if ( pthread_cond_init(&cond->cond, NULL) < 0 ) {
68 SDL_SetError("pthread_cond_init() failed"); 68 SDL_SetError("pthread_cond_init() failed");
69 free(cond); 69 SDL_free(cond);
70 cond = NULL; 70 cond = NULL;
71 } 71 }
72 } 72 }
73 return(cond); 73 return(cond);
74 } 74 }
76 /* Destroy a condition variable */ 76 /* Destroy a condition variable */
77 void SDL_DestroyCond(SDL_cond *cond) 77 void SDL_DestroyCond(SDL_cond *cond)
78 { 78 {
79 if ( cond ) { 79 if ( cond ) {
80 pthread_cond_destroy(&cond->cond); 80 pthread_cond_destroy(&cond->cond);
81 free(cond); 81 SDL_free(cond);
82 } 82 }
83 } 83 }
84 84
85 /* Restart one of the threads that are waiting on the condition variable */ 85 /* Restart one of the threads that are waiting on the condition variable */
86 int SDL_CondSignal(SDL_cond *cond) 86 int SDL_CondSignal(SDL_cond *cond)