Amanieu / parking_lot

Compact and efficient synchronization primitives for Rust. Also provides an API for creating custom synchronization primitives.
Apache License 2.0
2.77k stars 217 forks source link

lock_api: `RwLockReadGuard::unlocked` incorrectly claims fairness #381

Closed CAD97 closed 1 year ago

CAD97 commented 1 year ago

RwLockReadGuard::unlocked:

https://github.com/Amanieu/parking_lot/blob/de2a4023a652833688788b797c6b332e2466e8f0/lock_api/src/rwlock.rs#L1248-L1265

RwLockReadGuard::unlocked_fair:

https://github.com/Amanieu/parking_lot/blob/de2a4023a652833688788b797c6b332e2466e8f0/lock_api/src/rwlock.rs#L1290-L1307

Fix: just remove the line about being fair from RwLockReadGuard::unlocked's documentation.

This mistake is not present on upgradable read guards, write guards, nor mutex guards.