diff options
author | Rich Felker <dalias@aerifal.cx> | 2019-02-16 11:44:07 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2019-02-16 11:44:07 -0500 |
commit | 639bcf251e549f634da9a3e7ef8528eb2ec12505 (patch) | |
tree | 799fe258d444002e5f04c619e43cd46a0db94287 /src/thread/pthread_rwlock_timedrdlock.c | |
parent | ba74a42cee90c9a4425188a021b6ad8ba80b9468 (diff) | |
download | musl-639bcf251e549f634da9a3e7ef8528eb2ec12505.tar.gz |
introduce namespace-safe rwlock aliases; use in pthread_key_create
commit 84d061d5a31c9c773e29e1e2b1ffe8cb9557bc58 inadvertently
introduced namespace violations by using the pthread-namespace rwlock
functions in pthread_key_create, which is in turn used for C11 tss.
fix that and possible future uses of rwlocks elsewhere.
Diffstat (limited to 'src/thread/pthread_rwlock_timedrdlock.c')
-rw-r--r-- | src/thread/pthread_rwlock_timedrdlock.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/thread/pthread_rwlock_timedrdlock.c b/src/thread/pthread_rwlock_timedrdlock.c index 0d5d0d6c..8cdd8ecf 100644 --- a/src/thread/pthread_rwlock_timedrdlock.c +++ b/src/thread/pthread_rwlock_timedrdlock.c @@ -1,6 +1,6 @@ #include "pthread_impl.h" -int pthread_rwlock_timedrdlock(pthread_rwlock_t *restrict rw, const struct timespec *restrict at) +int __pthread_rwlock_timedrdlock(pthread_rwlock_t *restrict rw, const struct timespec *restrict at) { int r, t; @@ -10,7 +10,7 @@ int pthread_rwlock_timedrdlock(pthread_rwlock_t *restrict rw, const struct times int spins = 100; while (spins-- && rw->_rw_lock && !rw->_rw_waiters) a_spin(); - while ((r=pthread_rwlock_tryrdlock(rw))==EBUSY) { + while ((r=__pthread_rwlock_tryrdlock(rw))==EBUSY) { if (!(r=rw->_rw_lock) || (r&0x7fffffff)!=0x7fffffff) continue; t = r | 0x80000000; a_inc(&rw->_rw_waiters); @@ -21,3 +21,5 @@ int pthread_rwlock_timedrdlock(pthread_rwlock_t *restrict rw, const struct times } return r; } + +weak_alias(__pthread_rwlock_timedrdlock, pthread_rwlock_timedrdlock); |