Conversation
|
Code is wrong, ref https://docs.rs/parking_lot/latest/parking_lot/type.RwLock.html#method.upgradable_read: I put **s around the important part, which is the other upgradeable reads part. Credit to this Reddit post: https://www.reddit.com/r/rust/comments/nbrh9v/upgradable_parking_lotrwlock_might_not_do_what/ and this article: https://morestina.net/1739/upgradable-parking_lotrwlock-might-not-be-what-you-expect for pointing this out. |
|
Made it match the semantics of the one from parking_lot (sans the fairness discussed in #259) Playground I used to check behavior of the parking_lot RwLock: |
|
There is an alternative design which implements this with only one semaphore by making |
…s. Implement downgrade for RwLockUpgradableReadGuard
Adds upgradeable reads to
parking_lot::RwLockBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.