X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_mutex_trylock.c;h=db784a73a8b9bbc5d1ea400d8f440e7421765127;hb=8224bdbbedc60a5d637d95ddd344501f667f0294;hp=4a424bc91a4217e869fe29c55f6ddd681eb85e63;hpb=c68de0be2fb649f91b31080224fb6e48084eaaee;p=musl diff --git a/src/thread/pthread_mutex_trylock.c b/src/thread/pthread_mutex_trylock.c index 4a424bc9..db784a73 100644 --- a/src/thread/pthread_mutex_trylock.c +++ b/src/thread/pthread_mutex_trylock.c @@ -30,8 +30,6 @@ int pthread_mutex_trylock(pthread_mutex_t *m) if ((own && !(own & 0x40000000)) || a_cas(&m->_m_lock, old, tid)!=old) return EBUSY; - m->_m_count = 1; - if (m->_m_type < 4) return 0; if (m->_m_type >= 8) { @@ -45,6 +43,7 @@ int pthread_mutex_trylock(pthread_mutex_t *m) self->robust_list.head = &m->_m_next; self->robust_list.pending = 0; if (own) { + m->_m_count = 0; m->_m_type += 8; return EOWNERDEAD; }