about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2022-06-09 11:51:39 -0700
committerJosh Stone <jistone@redhat.com>2022-06-09 11:51:39 -0700
commit34895ded2c76cc87dc6ff33adaa541c239d416bf (patch)
tree2dce32a0db8647be4ac6fd4af490cdc6792e639c /compiler/rustc_codegen_llvm/src
parenta0411e2bfe1fb939757aa96603f0a10d1d9eb029 (diff)
downloadrust-34895ded2c76cc87dc6ff33adaa541c239d416bf.tar.gz
rust-34895ded2c76cc87dc6ff33adaa541c239d416bf.zip
Avoid `thread::panicking()` in non-poisoning methods of `Mutex` and `RwLock`
`Mutex::lock()` and `RwLock::write()` are poison-guarded against panics,
in that they set the poison flag if a panic occurs while they're locked.
But if we're already in a panic (`thread::panicking()`), they leave the
poison flag alone.

That check is a bit of a waste for methods that never set the poison
flag though, namely `get_mut()`, `into_inner()`, and `RwLock::read()`.
These use-cases are now split to avoid that unnecessary call.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions