Try to lock a mutex without blocking.
Defined in SDL_mutex.h
int SDL_TryLockMutex(SDL_mutex * mutex);
SDL_mutex * | mutex | the mutex to try to lock. |
(int) Returns 0, SDL_MUTEX_TIMEDOUT
, or -1 on error; call SDL_GetError() for more information.
This works just like SDL_LockMutex(), but if the mutex is not available, this function returns SDL_MUTEX_TIMEOUT
immediately.
This technique is useful if you need exclusive access to a resource but don't want to wait for it, and will return to it to try again later.
This function is available since SDL 2.0.0.