diff options
| author | Stuart Cook <Zalathar@users.noreply.github.com> | 2024-12-15 20:01:36 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-15 20:01:36 +1100 |
| commit | 66679081c7f2f881b09d84784a162b81c89d8edc (patch) | |
| tree | eb9368d216ddb2abff58cd58703da9c4840cfadd /compiler/rustc_codegen_llvm/src/errors.rs | |
| parent | acdcd3a895d5f7dc4b0bf6bfa10d4dfd8b98b439 (diff) | |
| parent | 242c6c33565f6287eb4fae4dfe1c65664aa19aec (diff) | |
| download | rust-66679081c7f2f881b09d84784a162b81c89d8edc.tar.gz rust-66679081c7f2f881b09d84784a162b81c89d8edc.zip | |
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.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/errors.rs')
0 files changed, 0 insertions, 0 deletions
