comparison src/thread/dc/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
44 /* Create a condition variable */ 44 /* Create a condition variable */
45 SDL_cond * SDL_CreateCond(void) 45 SDL_cond * SDL_CreateCond(void)
46 { 46 {
47 SDL_cond *cond; 47 SDL_cond *cond;
48 48
49 cond = (SDL_cond *) malloc(sizeof(SDL_cond)); 49 cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond));
50 if ( cond ) { 50 if ( cond ) {
51 cond->lock = SDL_CreateMutex(); 51 cond->lock = SDL_CreateMutex();
52 cond->wait_sem = SDL_CreateSemaphore(0); 52 cond->wait_sem = SDL_CreateSemaphore(0);
53 cond->wait_done = SDL_CreateSemaphore(0); 53 cond->wait_done = SDL_CreateSemaphore(0);
54 cond->waiting = cond->signals = 0; 54 cond->waiting = cond->signals = 0;
73 SDL_DestroySemaphore(cond->wait_done); 73 SDL_DestroySemaphore(cond->wait_done);
74 } 74 }
75 if ( cond->lock ) { 75 if ( cond->lock ) {
76 SDL_DestroyMutex(cond->lock); 76 SDL_DestroyMutex(cond->lock);
77 } 77 }
78 free(cond); 78 SDL_free(cond);
79 } 79 }
80 } 80 }
81 81
82 /* Restart one of the threads that are waiting on the condition variable */ 82 /* Restart one of the threads that are waiting on the condition variable */
83 int SDL_CondSignal(SDL_cond *cond) 83 int SDL_CondSignal(SDL_cond *cond)