Closed
Description
According to this back and forth on a Microsoft blog post, it is currently undefined behavior to even try to acquire an SRWLock recursively, even recursive read locks.
It might (and probably will) cause the lock to fail to fulfil its contract in the future (e.g,. allow two simultaneous exclusive acquisitions). And since wait nodes are threaded on the stack, it can result in stack memory corruption.
Also apparently NT keyed events have no stability guarantee so the current implementation of No longer an issue as parking_lot
on Windows could theoretically break with a new version of Windows.parking_lot
uses the stable WaitOnAddress
on newer Windows.
So uh, what do?