1 #include <pthreadP.h> 2 3 #define LLL_MUTEX_LOCK(mutex) \ 4 lll_cond_lock ((mutex)->__data.__lock, PTHREAD_MUTEX_PSHARED (mutex)) 5 #define LLL_MUTEX_LOCK_OPTIMIZED(mutex) LLL_MUTEX_LOCK (mutex) 6 7 /* Not actually elided so far. Needed? */ 8 #define LLL_MUTEX_LOCK_ELISION(mutex) \ 9 ({ lll_cond_lock ((mutex)->__data.__lock, PTHREAD_MUTEX_PSHARED (mutex)); 0; }) 10 11 #define LLL_MUTEX_TRYLOCK(mutex) \ 12 lll_cond_trylock ((mutex)->__data.__lock) 13 #define LLL_MUTEX_TRYLOCK_ELISION(mutex) LLL_MUTEX_TRYLOCK(mutex) 14 15 /* We need to assume that there are other threads blocked on the futex. 16 See __pthread_mutex_lock_full for further details. */ 17 #define LLL_ROBUST_MUTEX_LOCK_MODIFIER FUTEX_WAITERS 18 #define PTHREAD_MUTEX_LOCK __pthread_mutex_cond_lock 19 #define __pthread_mutex_lock_full __pthread_mutex_cond_lock_full 20 #define NO_INCR 21 #define PTHREAD_MUTEX_VERSIONS 0 22 23 #include <nptl/pthread_mutex_lock.c> 24