Mercurial > sdl-ios-xcode
comparison src/thread/generic/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 | 450721ad5436 |
children | 604d73db6802 |
comparison
equal
deleted
inserted
replaced
1335:c39265384763 | 1336:3692456e7b0f |
---|---|
42 /* Create a condition variable */ | 42 /* Create a condition variable */ |
43 SDL_cond * SDL_CreateCond(void) | 43 SDL_cond * SDL_CreateCond(void) |
44 { | 44 { |
45 SDL_cond *cond; | 45 SDL_cond *cond; |
46 | 46 |
47 cond = (SDL_cond *) malloc(sizeof(SDL_cond)); | 47 cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond)); |
48 if ( cond ) { | 48 if ( cond ) { |
49 cond->lock = SDL_CreateMutex(); | 49 cond->lock = SDL_CreateMutex(); |
50 cond->wait_sem = SDL_CreateSemaphore(0); | 50 cond->wait_sem = SDL_CreateSemaphore(0); |
51 cond->wait_done = SDL_CreateSemaphore(0); | 51 cond->wait_done = SDL_CreateSemaphore(0); |
52 cond->waiting = cond->signals = 0; | 52 cond->waiting = cond->signals = 0; |
71 SDL_DestroySemaphore(cond->wait_done); | 71 SDL_DestroySemaphore(cond->wait_done); |
72 } | 72 } |
73 if ( cond->lock ) { | 73 if ( cond->lock ) { |
74 SDL_DestroyMutex(cond->lock); | 74 SDL_DestroyMutex(cond->lock); |
75 } | 75 } |
76 free(cond); | 76 SDL_free(cond); |
77 } | 77 } |
78 } | 78 } |
79 | 79 |
80 /* Restart one of the threads that are waiting on the condition variable */ | 80 /* Restart one of the threads that are waiting on the condition variable */ |
81 int SDL_CondSignal(SDL_cond *cond) | 81 int SDL_CondSignal(SDL_cond *cond) |