From: Apple Date: Wed, 29 Jan 2020 22:30:31 +0000 (+0000) Subject: libplatform-177.270.1.tar.gz X-Git-Tag: macos-10146^0 X-Git-Url: https://git.saurik.com/apple/libplatform.git/commitdiff_plain/b2271b9bbd13aff84e1092bf07df04140f6389dd libplatform-177.270.1.tar.gz --- diff --git a/src/os/lock.c b/src/os/lock.c index ab9e4ba..9230ac8 100644 --- a/src/os/lock.c +++ b/src/os/lock.c @@ -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,