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.
15 lines
361 B
C
15 lines
361 B
C
#include "pthread_impl.h"
|
|
|
|
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);
|
|
}
|
|
|
|
weak_alias(__pthread_mutex_lock, pthread_mutex_lock);
|