we're not required to check this except for error-checking mutexes,
but it doesn't hurt. the new test is actually simpler/lighter, and it
also eliminates the need to later check that pthread_mutex_unlock
succeeds.
struct cm cm = { .c=c, .m=m };
int r, e=0, seq;
- if ((m->_m_type&3) == PTHREAD_MUTEX_ERRORCHECK &&
- (m->_m_lock&INT_MAX) != __pthread_self()->tid) return EPERM;
+ if (m->_m_type && (m->_m_lock&INT_MAX) != __pthread_self()->tid)
+ return EPERM;
if (ts && ts->tv_nsec >= 1000000000UL)
return EINVAL;
seq = c->_c_seq;
- if ((r=pthread_mutex_unlock(m))) return r;
+ pthread_mutex_unlock(m);
do e = __timedwait(&c->_c_seq, seq, c->_c_clock, ts, cleanup, &cm, 0);
while (c->_c_seq == seq && (!e || e==EINTR));