glibc/nptl/sysdeps/unix/sysv/linux/pthread-pi-defines.sym
Siddhesh Poyarekar 0e3b5d6a68 Take lock in pthread_cond_wait cleanup handler only when needed
[BZ #14652]
When a thread waiting in pthread_cond_wait with a PI mutex is
cancelled after it has returned successfully from the futex syscall
but just before async cancellation is disabled, it enters its
cancellation handler with the mutex held and simply calling a
mutex_lock again will result in a deadlock.  Hence, it is necessary to
see if the thread owns the lock and try to lock it only if it doesn't.
2012-10-10 12:52:56 +05:30

10 lines
261 B
Plaintext

#include <pthreadP.h>
-- These PI macros are used by assembly code.
MUTEX_KIND offsetof (pthread_mutex_t, __data.__kind)
ROBUST_BIT PTHREAD_MUTEX_ROBUST_NORMAL_NP
PI_BIT PTHREAD_MUTEX_PRIO_INHERIT_NP
PS_BIT PTHREAD_MUTEX_PSHARED_BIT
TID_MASK FUTEX_TID_MASK