pthread_rwlockattr_setkind_np.3: Clarify a PTHREAD_RWLOCK_PREFER_WRITER_NP detail

Clarify that it is recursive read locks on the read-write lock
that make it difficult to implement
PTHREAD_RWLOCK_PREFER_WRITER_NP.

Update the libc-alpha URL and provide the URL to the POSIX wording
that is quoted in the comment.

Reported-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Carlos O'Donell 2020-07-16 15:50:28 -04:00 committed by Michael Kerrisk
parent 80c5b48d9c
commit c47c61c330
1 changed files with 3 additions and 2 deletions

View File

@ -80,7 +80,7 @@ starved.
This is intended as the write lock analog of
.BR PTHREAD_RWLOCK_PREFER_READER_NP .
This is ignored by glibc because the POSIX requirement to support
recursive writer locks would cause this option to create trivial
recursive read locks would cause this option to create trivial
deadlocks; instead use
.B PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP
which ensures the application developer will not take recursive
@ -102,7 +102,8 @@ read locks thus avoiding deadlocks.
.\" the writers to acquire and release the lock, and the writers will be
.\" suspended waiting for every existing read lock to be released.
.\" ---
.\" http://sources.redhat.com/ml/libc-alpha/2000-01/msg00055.html
.\" https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_rwlock_rdlock.html
.\" https://sourceware.org/legacy-ml/libc-alpha/2000-01/msg00055.html
.\" https://sourceware.org/bugzilla/show_bug.cgi?id=7057
.TP
.B PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP