Skip to content

gthread: Clarify priority handling in GRWLock

Philip Withnall requested to merge rw-lock-docs into master

As we use pthread_rwlock_*() to implement GRWLock (on Unix), the priority of readers vs writers when trying to acquire a lock already held by one reader with a writer queued, is unspecified. i.e. We don’t explicitly prioritise the pending readers to acquire the lock (and block the writer), or vice-versa.

Whatever our implementation on other platforms, we must document the priority as unspecified, as that’s what happens on Unix and is the least restrictive API guarantee we can make.

Prompted by https://stackoverflow.com/q/52661672/2931197.

Signed-off-by: Philip Withnall withnall@endlessm.com

Merge request reports