Mercurial > sdl-ios-xcode
comparison src/thread/pth/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 | 1d74ddc90cb2 |
children | 604d73db6802 |
comparison
equal
deleted
inserted
replaced
1335:c39265384763 | 1336:3692456e7b0f |
---|---|
16 /* Create a condition variable */ | 16 /* Create a condition variable */ |
17 SDL_cond * SDL_CreateCond(void) | 17 SDL_cond * SDL_CreateCond(void) |
18 { | 18 { |
19 SDL_cond *cond; | 19 SDL_cond *cond; |
20 | 20 |
21 cond = (SDL_cond *) malloc(sizeof(SDL_cond)); | 21 cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond)); |
22 if ( cond ) { | 22 if ( cond ) { |
23 if ( pth_cond_init(&(cond->condpth_p)) < 0 ) { | 23 if ( pth_cond_init(&(cond->condpth_p)) < 0 ) { |
24 SDL_SetError("pthread_cond_init() failed"); | 24 SDL_SetError("pthread_cond_init() failed"); |
25 free(cond); | 25 SDL_free(cond); |
26 cond = NULL; | 26 cond = NULL; |
27 } | 27 } |
28 } else { | 28 } else { |
29 SDL_OutOfMemory(); | 29 SDL_OutOfMemory(); |
30 } | 30 } |
33 | 33 |
34 /* Destroy a condition variable */ | 34 /* Destroy a condition variable */ |
35 void SDL_DestroyCond(SDL_cond *cond) | 35 void SDL_DestroyCond(SDL_cond *cond) |
36 { | 36 { |
37 if ( cond ) { | 37 if ( cond ) { |
38 free(cond); | 38 SDL_free(cond); |
39 } | 39 } |
40 } | 40 } |
41 | 41 |
42 /* Restart one of the threads that are waiting on the condition variable */ | 42 /* Restart one of the threads that are waiting on the condition variable */ |
43 int SDL_CondSignal(SDL_cond *cond) | 43 int SDL_CondSignal(SDL_cond *cond) |