]> git.saurik.com Git - apple/libplatform.git/commitdiff
libplatform-177.270.1.tar.gz macos-10146 v177.270.1
authorApple <opensource@apple.com>
Wed, 29 Jan 2020 22:30:31 +0000 (22:30 +0000)
committerApple <opensource@apple.com>
Wed, 29 Jan 2020 22:30:31 +0000 (22:30 +0000)
src/os/lock.c

index ab9e4ba4e310607ae23eb44a6b244ff19612bd15..9230ac85173164caf01d34eef37c1d5cf3d17bcc 100644 (file)
@@ -497,8 +497,10 @@ _retry:
                                __LIBPLATFORM_INTERNAL_CRASH__(-ret, "ulock_wait failure");
                        }
                }
-               // If there are more waiters, unset nowaiters bit when acquiring lock
-               waiters_mask = (ret > 0) ? OS_ULOCK_NOWAITERS_BIT : 0;
+               if (ret > 0) {
+                       // If there are more waiters, unset nowaiters bit when acquiring lock
+                       waiters_mask = OS_ULOCK_NOWAITERS_BIT;
+               }
        }
        new = self & ~waiters_mask;
        bool r = os_atomic_cmpxchgv2o(l, oul_value, OS_LOCK_NO_OWNER, new,
@@ -810,8 +812,10 @@ _retry:
                                __LIBPLATFORM_INTERNAL_CRASH__(-ret, "ulock_wait failure");
                        }
                }
-               // If there are more waiters, unset nowaiters bit when acquiring lock
-               waiters_mask = (ret > 0) ? OS_ULOCK_NOWAITERS_BIT : 0;
+               if (ret > 0) {
+                       // If there are more waiters, unset nowaiters bit when acquiring lock
+                       waiters_mask = OS_ULOCK_NOWAITERS_BIT;
+               }
        }
        new = self & ~waiters_mask;
        bool r = os_atomic_cmpxchgv2o(l, oul_value, OS_LOCK_NO_OWNER, new,