Explorar o código

mutex: Fixed bug where generic SDL_TryLockMutex would incorrectly block.

Fixes #8433.
Ryan C. Gordon %!s(int64=2) %!d(string=hai) anos
pai
achega
ace0c2c297
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/thread/generic/SDL_sysmutex.c

+ 1 - 1
src/thread/generic/SDL_sysmutex.c

@@ -118,7 +118,7 @@ int SDL_TryLockMutex(SDL_Mutex *mutex)
          We set the locking thread id after we obtain the lock
          We set the locking thread id after we obtain the lock
          so unlocks from other threads will fail.
          so unlocks from other threads will fail.
          */
          */
-        retval = SDL_WaitSemaphore(mutex->sem);
+        retval = SDL_TryWaitSemaphore(mutex->sem);
         if (retval == 0) {
         if (retval == 0) {
             mutex->owner = this_thread;
             mutex->owner = this_thread;
             mutex->recursive = 0;
             mutex->recursive = 0;