Hacker News new | ask | show | jobs
by tialaramex 834 days ago
Yes, for example if you make a Rust std::sync:RWLock on Windows, it will literally be SRWLock because Microsoft advertises this API as having exactly the behaviour Rust wants so why would you build something worse instead ?

Rust's Mutex on Windows is also an SRWLock but it can't hit this bug because it deliberately only uses the exclusive locking.

1 comments

So it doesn't use a shared lock when .read() is used?
Rust has both Mutex and RWLock. The Mutex only uses exclusive locks, there's no distinction between "read" and "write".
Oh sorry my morning brain thought the comment was all about RWLock