zig icon indicating copy to clipboard operation
zig copied to clipboard

Clarify the blocking behavior of `RwLock.lockShared()`.

Open IntegratedQuantum opened this issue 1 year ago • 1 comments

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.

IntegratedQuantum avatar Apr 23 '24 20:04 IntegratedQuantum

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.

kprotty avatar Apr 23 '24 22:04 kprotty