فهرست منبع

wayland: Cleanup some SDL_TryLockMutex() calls.

Check the result of these against 0 explicitly, so that it's obvious
we're bailing out on failure, not success.
David Gow 3 سال پیش
والد
کامیت
eadc8f9355
2فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 1 1
      src/video/wayland/SDL_waylandevents.c
  2. 1 1
      src/video/wayland/SDL_waylandopengles.c

+ 1 - 1
src/video/wayland/SDL_waylandevents.c

@@ -234,7 +234,7 @@ Wayland_PumpEvents(_THIS)
     /* If we're trying to dispatch the display in another thread,
      * we could trigger a race condition and end up blocking
      * in wl_display_dispatch() */
-    if (SDL_TryLockMutex(d->display_dispatch_lock)) {
+    if (SDL_TryLockMutex(d->display_dispatch_lock) != 0) {
         return;
     }
 

+ 1 - 1
src/video/wayland/SDL_waylandopengles.c

@@ -151,7 +151,7 @@ Wayland_GLES_SwapWindow(_THIS, SDL_Window *window)
 
             /* Make sure we're not competing with SDL_PumpEvents() for any new
              * events, or one of us may end up blocking in wl_display_dispatch */
-            if (SDL_TryLockMutex(videodata->display_dispatch_lock)) {
+            if (SDL_TryLockMutex(videodata->display_dispatch_lock) != 0) {
                 continue;
             }