123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- #ifndef _SDL_mutex_h
- #define _SDL_mutex_h
- #include "SDL_stdinc.h"
- #include "SDL_error.h"
- #include "begin_code.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- #define SDL_MUTEX_TIMEDOUT 1
- #define SDL_MUTEX_MAXWAIT (~(Uint32)0)
-
- struct SDL_mutex;
- typedef struct SDL_mutex SDL_mutex;
- extern DECLSPEC SDL_mutex * SDLCALL SDL_CreateMutex(void);
- #define SDL_LockMutex(m) SDL_mutexP(m)
- extern DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex *mutex);
- #define SDL_UnlockMutex(m) SDL_mutexV(m)
- extern DECLSPEC int SDLCALL SDL_mutexV(SDL_mutex *mutex);
- extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex *mutex);
-
- struct SDL_semaphore;
- typedef struct SDL_semaphore SDL_sem;
- extern DECLSPEC SDL_sem * SDLCALL SDL_CreateSemaphore(Uint32 initial_value);
- extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem *sem);
- extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem *sem);
- extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem *sem);
- extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 ms);
- extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem *sem);
- extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem *sem);
-
- struct SDL_cond;
- typedef struct SDL_cond SDL_cond;
- extern DECLSPEC SDL_cond * SDLCALL SDL_CreateCond(void);
- extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond *cond);
- extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond *cond);
- extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond *cond);
- extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond *cond, SDL_mutex *mut);
- extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms);
- #ifdef __cplusplus
- }
- #endif
- #include "close_code.h"
- #endif
|