aboutsummaryrefslogtreecommitdiff
path: root/nptl/pthread_rwlock_unlock.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/pthread_rwlock_unlock.c')
-rw-r--r--nptl/pthread_rwlock_unlock.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/nptl/pthread_rwlock_unlock.c b/nptl/pthread_rwlock_unlock.c
index a6cadd491d..112f748a6b 100644
--- a/nptl/pthread_rwlock_unlock.c
+++ b/nptl/pthread_rwlock_unlock.c
@@ -35,6 +35,10 @@ __pthread_rwlock_unlock (pthread_rwlock_t *rwlock)
LIBC_PROBE (rwlock_unlock, 1, rwlock);
+ /* Trying to elide an unlocked lock may crash the process. This
+ is expected and is compatible with POSIX.1-2008: "results are
+ undefined if the read-write lock rwlock is not held by the
+ calling thread". */
if (ELIDE_UNLOCK (rwlock->__data.__writer == 0
&& rwlock->__data.__nr_readers == 0))
return 0;