diff options
-rw-r--r-- | src/thread/pthread_mutex_unlock.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/thread/pthread_mutex_unlock.c b/src/thread/pthread_mutex_unlock.c index 67aa7ba5..5855db0b 100644 --- a/src/thread/pthread_mutex_unlock.c +++ b/src/thread/pthread_mutex_unlock.c @@ -14,11 +14,15 @@ int pthread_mutex_unlock(pthread_mutex_t *m) self->robust_list.pending = &m->_m_next; *(void **)m->_m_prev = m->_m_next; if (m->_m_next) ((void **)m->_m_next)[-1] = m->_m_prev; + a_store(&m->_m_lock, 0); + self->robust_list.pending = 0; + } else { + a_store(&m->_m_lock, 0); } + } else { + a_store(&m->_m_lock, 0); } - m->_m_lock = 0; if (m->_m_waiters) __wake(&m->_m_lock, 1, 0); - if (m->_m_type >= 4) self->robust_list.pending = 0; return 0; } |