rust/library/std
Stuart Cook 66679081c7
Rollup merge of #133406 - EFanZh:lock-value-accessors, r=Noratrieb
Add value accessor methods to `Mutex` and `RwLock`

- ACP: https://github.com/rust-lang/libs-team/issues/485.
- Tracking issue: https://github.com/rust-lang/rust/issues/133407.

This PR adds `get`, `set` and `replace` methods to the `Mutex` and `RwLock` types for quick access to their contained values.

One possible optimization would be to check for poisoning first and return an error immediately, without attempting to acquire the lock. I didn’t implement this because I consider poisoning to be relatively rare, adding this extra check could slow down common use cases.
2024-12-15 20:01:36 +11:00
..
benches Reformat use declarations. 2024-07-29 08:26:52 +10:00
src Rollup merge of #133406 - EFanZh:lock-value-accessors, r=Noratrieb 2024-12-15 20:01:36 +11:00
tests Fix and undeprecate home_dir() 2024-11-04 03:06:09 +00:00
build.rs Enable f128 tests on all non-buggy platforms 🎉 2024-11-03 19:33:04 -06:00
Cargo.toml Rollup merge of #133515 - SteveLauC:fix/hurd, r=ChrisDenton 2024-12-01 08:15:22 +01:00