mirror of
https://github.com/fluencelabs/musl
synced 2025-07-31 22:31:58 +00:00
add fast path for normal mutexes back to pthread_mutex_lock
This commit is contained in:
@@ -2,5 +2,8 @@
|
|||||||
|
|
||||||
int pthread_mutex_lock(pthread_mutex_t *m)
|
int pthread_mutex_lock(pthread_mutex_t *m)
|
||||||
{
|
{
|
||||||
|
if (m->_m_type == PTHREAD_MUTEX_NORMAL && !a_cas(&m->_m_lock, 0, EBUSY))
|
||||||
|
return 0;
|
||||||
|
|
||||||
return pthread_mutex_timedlock(m, 0);
|
return pthread_mutex_timedlock(m, 0);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user