From df7d0dfb9c686df31149d09008ba92834bed9803 Mon Sep 17 00:00:00 2001 From: Jens Gustedt Date: Mon, 1 Sep 2014 00:46:23 +0200 Subject: use weak symbols for the POSIX functions that will be used by C threads The intent of this is to avoid name space pollution of the C threads implementation. This has two sides to it. First we have to provide symbols that wouldn't pollute the name space for the C threads implementation. Second we have to clean up some internal uses of POSIX functions such that they don't implicitly drag in such symbols. --- src/thread/pthread_mutex_lock.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/thread/pthread_mutex_lock.c') diff --git a/src/thread/pthread_mutex_lock.c b/src/thread/pthread_mutex_lock.c index 2a9a3aa4..d0c93cab 100644 --- a/src/thread/pthread_mutex_lock.c +++ b/src/thread/pthread_mutex_lock.c @@ -1,10 +1,14 @@ #include "pthread_impl.h" -int pthread_mutex_lock(pthread_mutex_t *m) +int __pthread_mutex_timedlock(pthread_mutex_t *restrict, const struct timespec *restrict); + +int __pthread_mutex_lock(pthread_mutex_t *m) { if ((m->_m_type&15) == PTHREAD_MUTEX_NORMAL && !a_cas(&m->_m_lock, 0, EBUSY)) return 0; - return pthread_mutex_timedlock(m, 0); + return __pthread_mutex_timedlock(m, 0); } + +weak_alias(__pthread_mutex_lock, pthread_mutex_lock); -- cgit v1.2.1