X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=inline;f=src%2Fthread%2Fpthread_mutex_consistent.c;h=96b83b52851b202aed9f817447129792833d1da1;hb=3b27725385614d44add9351191765181edc3f4c1;hp=65da29fa88a25b4f652b1492f5206d7499ab85c3;hpb=df15168cf8baf34fb9c94e19eaa1a5c79c853970;p=musl diff --git a/src/thread/pthread_mutex_consistent.c b/src/thread/pthread_mutex_consistent.c index 65da29fa..96b83b52 100644 --- a/src/thread/pthread_mutex_consistent.c +++ b/src/thread/pthread_mutex_consistent.c @@ -2,9 +2,9 @@ int pthread_mutex_consistent(pthread_mutex_t *m) { - if (m->_m_type < 8) return EINVAL; - if ((m->_m_lock & 0x3fffffff) != __pthread_self()->tid) + if (!(m->_m_type & 8)) return EINVAL; + if ((m->_m_lock & 0x7fffffff) != __pthread_self()->tid) return EPERM; - m->_m_type -= 8; + m->_m_type &= ~8U; return 0; }