1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-11-21 15:17:39 +01:00

Use adaptive mutexes when available.

This commit is contained in:
Arun Sharma 2013-11-17 20:33:33 -08:00
parent 2c3444d0f4
commit 85ce920cff

View file

@ -186,8 +186,15 @@ static inline void mark_as_used(void *v UNUSED) {
# define SIGPROCMASK(how, new_mask, old_mask) mark_as_used(old_mask)
#endif
/* Prefer adaptive mutexes if available */
#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
#define UNW_PTHREAD_MUTEX_INITIALIZER PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
#else
#define UNW_PTHREAD_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
#endif
#define define_lock(name) \
pthread_mutex_t name = PTHREAD_MUTEX_INITIALIZER
pthread_mutex_t name = UNW_PTHREAD_MUTEX_INITIALIZER
#define lock_init(l) mutex_init (l)
#define lock_acquire(l,m) \
do { \