Lines Matching refs:mutex
41 SDL_mutex *mutex; in SDL_CreateMutex() local
44 mutex = (SDL_mutex *) SDL_malloc(sizeof(*mutex)); in SDL_CreateMutex()
45 if (mutex) { in SDL_CreateMutex()
49 InitializeCriticalSectionEx(&mutex->cs, 2000, 0); in SDL_CreateMutex()
51 InitializeCriticalSectionAndSpinCount(&mutex->cs, 2000); in SDL_CreateMutex()
56 return (mutex); in SDL_CreateMutex()
61 SDL_DestroyMutex(SDL_mutex * mutex) in SDL_DestroyMutex() argument
63 if (mutex) { in SDL_DestroyMutex()
64 DeleteCriticalSection(&mutex->cs); in SDL_DestroyMutex()
65 SDL_free(mutex); in SDL_DestroyMutex()
71 SDL_LockMutex(SDL_mutex * mutex) in SDL_LockMutex() argument
73 if (mutex == NULL) { in SDL_LockMutex()
77 EnterCriticalSection(&mutex->cs); in SDL_LockMutex()
83 SDL_TryLockMutex(SDL_mutex * mutex) in SDL_TryLockMutex() argument
86 if (mutex == NULL) { in SDL_TryLockMutex()
90 if (TryEnterCriticalSection(&mutex->cs) == 0) { in SDL_TryLockMutex()
98 SDL_UnlockMutex(SDL_mutex * mutex) in SDL_UnlockMutex() argument
100 if (mutex == NULL) { in SDL_UnlockMutex()
104 LeaveCriticalSection(&mutex->cs); in SDL_UnlockMutex()