about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/errors.rs
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2024-12-15 20:01:36 +1100
committerGitHub <noreply@github.com>2024-12-15 20:01:36 +1100
commit66679081c7f2f881b09d84784a162b81c89d8edc (patch)
treeeb9368d216ddb2abff58cd58703da9c4840cfadd /compiler/rustc_codegen_llvm/src/errors.rs
parentacdcd3a895d5f7dc4b0bf6bfa10d4dfd8b98b439 (diff)
parent242c6c33565f6287eb4fae4dfe1c65664aa19aec (diff)
downloadrust-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