• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include "pthread_impl.h"
2 
3 #ifndef __LITEOS__
4 extern int __pthread_mutex_timedlock_inner(pthread_mutex_t *restrict m, const struct timespec *restrict at);
5 #endif
__pthread_mutex_lock(pthread_mutex_t * m)6 int __pthread_mutex_lock(pthread_mutex_t *m)
7 {
8 	if ((m->_m_type&15) == PTHREAD_MUTEX_NORMAL
9 	    && !a_cas(&m->_m_lock, 0, EBUSY))
10 		return 0;
11 
12 #ifndef __LITEOS__
13 	return __pthread_mutex_timedlock_inner(m, 0);
14 #else
15 	return __pthread_mutex_timedlock(m, 0);
16 #endif
17 }
18 
19 weak_alias(__pthread_mutex_lock, pthread_mutex_lock);
20