zig
zig copied to clipboard
Clarify the blocking behavior of `RwLock.lockShared()`.
I just spend a few hours tracing a deadlock in my code, until I discovered that my mental model of the RwLock was wrong. So I decided to clarify the behavior in the doc-comment.
This also brings attention to the module documentation being old, noting RwLock requires runtime initialization. With a non-futex based implementation, leaky pthread_rwlock_t usage, and lack of SRWLOCK, zig's stdlib RwLocks seems due for a rewrite.