fix harmless-by-chance typo in priority inheritance mutex code
authorRich Felker <dalias@aerifal.cx>
Mon, 1 Apr 2019 22:51:50 +0000 (18:51 -0400)
committerRich Felker <dalias@aerifal.cx>
Mon, 1 Apr 2019 22:51:50 +0000 (18:51 -0400)
commit 54ca677983d47529bab8752315ac1a2b49888870 inadvertently
introduced bitwise and where logical and was intended. since the
right-hand operand is always 0 or -1 whenever the left-hand operand is
nonzero, the behavior happened to be equivalent.

src/thread/pthread_mutex_trylock.c

index 37e5c473c480a9f16762ca4305feb352ed70658e..a24e7c58ac390d857bf41d305d6a2e317ab7c38f 100644 (file)
@@ -36,7 +36,7 @@ int __pthread_mutex_trylock_owner(pthread_mutex_t *m)
 
        if (a_cas(&m->_m_lock, old, tid) != old) {
                self->robust_list.pending = 0;
-               if ((type&12)==12 & m->_m_waiters) return ENOTRECOVERABLE;
+               if ((type&12)==12 && m->_m_waiters) return ENOTRECOVERABLE;
                return EBUSY;
        }