diff options
author | Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com> | 2016-10-28 18:31:24 -0200 |
---|---|---|
committer | Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com> | 2016-10-28 19:13:21 -0200 |
commit | 739e14f9009ff91e4a8d01776e7269fc8cbd0293 (patch) | |
tree | b8819e16088ba37dcc26c7cfa7f1ae486b7e474f /nptl | |
parent | ce193f551ec21df85c934626a21730881484dcf0 (diff) | |
download | glibc-739e14f9009ff91e4a8d01776e7269fc8cbd0293.zip glibc-739e14f9009ff91e4a8d01776e7269fc8cbd0293.tar.gz glibc-739e14f9009ff91e4a8d01776e7269fc8cbd0293.tar.bz2 |
Document a behavior of an elided pthread_rwlock_unlock
Explain that pthread_rwlock_unlock may crash if called on a lock not
held by the current thread.
Diffstat (limited to 'nptl')
-rw-r--r-- | nptl/pthread_rwlock_unlock.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/nptl/pthread_rwlock_unlock.c b/nptl/pthread_rwlock_unlock.c index a6cadd4..112f748 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; |