21 #include "../../SDL_internal.h"
28 #include "SDL_systhread_c.h"
29 #include "../../core/os2/SDL_os2.h"
31 #define INCL_DOSSEMAPHORES
32 #define INCL_DOSERRORS
46 ulRC = DosCreateMutexSem(
NULL, &hMtx, 0,
FALSE);
47 if (ulRC != NO_ERROR) {
48 debug_os2(
"DosCreateMutexSem(), rc = %u", ulRC);
60 HMTX hMtx = (HMTX)
mutex;
62 ulRC = DosCloseMutexSem(hMtx);
63 if (ulRC != NO_ERROR) {
64 debug_os2(
"DosCloseMutexSem(), rc = %u", ulRC);
73 HMTX hMtx = (HMTX)
mutex;
75 if (hMtx == NULLHANDLE)
78 ulRC = DosRequestMutexSem(hMtx, SEM_INDEFINITE_WAIT);
79 if (ulRC != NO_ERROR) {
80 debug_os2(
"DosRequestMutexSem(), rc = %u", ulRC);
92 HMTX hMtx = (HMTX)
mutex;
94 if (hMtx == NULLHANDLE)
97 ulRC = DosRequestMutexSem(hMtx, SEM_IMMEDIATE_RETURN);
99 if (ulRC == ERROR_TIMEOUT)
102 if (ulRC != NO_ERROR) {
103 debug_os2(
"DosRequestMutexSem(), rc = %u", ulRC);
115 HMTX hMtx = (HMTX)
mutex;
117 if (hMtx == NULLHANDLE)
120 ulRC = DosReleaseMutexSem(hMtx);
121 if (ulRC != NO_ERROR)
122 return SDL_SetError(
"DosReleaseMutexSem(), rc = %u", ulRC);
#define SDL_MUTEX_TIMEDOUT
void SDL_DestroyMutex(SDL_mutex *mutex)
int SDL_LockMutex(SDL_mutex *mutex)
int SDL_TryLockMutex(SDL_mutex *mutex)
SDL_mutex * SDL_CreateMutex(void)
int SDL_UnlockMutex(SDL_mutex *mutex)