diff options
Diffstat (limited to 'nptl/pthread_mutex_consistent.c')
-rw-r--r-- | nptl/pthread_mutex_consistent.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/nptl/pthread_mutex_consistent.c b/nptl/pthread_mutex_consistent.c index 85b8e1a6cb..4fbd875430 100644 --- a/nptl/pthread_mutex_consistent.c +++ b/nptl/pthread_mutex_consistent.c @@ -23,8 +23,11 @@ int pthread_mutex_consistent (pthread_mutex_t *mutex) { - /* Test whether this is a robust mutex with a dead owner. */ - if ((mutex->__data.__kind & PTHREAD_MUTEX_ROBUST_NORMAL_NP) == 0 + /* Test whether this is a robust mutex with a dead owner. + See concurrency notes regarding __kind in struct __pthread_mutex_s + in sysdeps/nptl/bits/thread-shared-types.h. */ + if ((atomic_load_relaxed (&(mutex->__data.__kind)) + & PTHREAD_MUTEX_ROBUST_NORMAL_NP) == 0 || mutex->__data.__owner != PTHREAD_MUTEX_INCONSISTENT) return EINVAL; |