summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2018-09-04 22:56:57 -0400
committerRich Felker <dalias@aerifal.cx>2018-09-04 22:56:57 -0400
commit2de29bc994029b903a366b8a4a9f8c3c3ee2be90 (patch)
treeb73796c45dc1244b81a3ea30fa876ecad63a8d41 /src
parentd1fa28860634af4f0efd70d533a756b51a45f83e (diff)
downloadmusl-2de29bc994029b903a366b8a4a9f8c3c3ee2be90.tar.gz
fix namespace violation for c11 mutex functions
__pthread_mutex_timedlock is used to implement c11 mutex functions, and therefore cannot call pthread_mutex_trylock by name.
Diffstat (limited to 'src')
-rw-r--r--src/thread/pthread_mutex_timedlock.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/thread/pthread_mutex_timedlock.c b/src/thread/pthread_mutex_timedlock.c
index f91f4a61..d2bd1960 100644
--- a/src/thread/pthread_mutex_timedlock.c
+++ b/src/thread/pthread_mutex_timedlock.c
@@ -1,5 +1,7 @@
#include "pthread_impl.h"
+int __pthread_mutex_trylock(pthread_mutex_t *);
+
int __pthread_mutex_timedlock(pthread_mutex_t *restrict m, const struct timespec *restrict at)
{
if ((m->_m_type&15) == PTHREAD_MUTEX_NORMAL
@@ -15,7 +17,7 @@ int __pthread_mutex_timedlock(pthread_mutex_t *restrict m, const struct timespec
int spins = 100;
while (spins-- && m->_m_lock && !m->_m_waiters) a_spin();
- while ((r=pthread_mutex_trylock(m)) == EBUSY) {
+ while ((r=__pthread_mutex_trylock(m)) == EBUSY) {
if (!(r=m->_m_lock) || ((r&0x40000000) && (type&4)))
continue;
if ((type&3) == PTHREAD_MUTEX_ERRORCHECK