Try to lock a mutex without blocking.
int SDL_TryLockMutex(SDL_mutex * mutex);
the mutex to try to lock
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
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.