News for hackers. Stuff that matters.
Re:Bug in std:shared_mutex on Windows by tialaramex on Sunday March 03, 2024 @02:26PM (#39583584)
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.

Re:Bug in std:shared_mutex on Windows by iknowstuff on Sunday March 03, 2024 @03:12PM (#39584036)
So it doesn't use a shared lock when .read() is used?
Re:Bug in std:shared_mutex on Windows by zozbot234 on Sunday March 03, 2024 @03:18PM (#39584126)
Rust has both Mutex and RWLock. The Mutex only uses exclusive locks, there's no distinction between "read" and "write".
Re:Bug in std:shared_mutex on Windows by iknowstuff on Sunday March 03, 2024 @03:20PM (#39584141)
Oh sorry my morning brain thought the comment was all about RWLock