rust/library
bors ec21d7ea3c Auto merge of #97924 - cuviper:unguarded-poison, r=Mark-Simulacrum
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.
2022-06-18 15:18:50 +00:00
..
2022-05-20 09:30:26 +02:00
2022-06-03 17:16:41 -04:00
2022-05-27 07:36:17 -04:00
2022-06-17 22:10:07 -04:00
2022-06-03 17:16:41 -04:00
2022-06-03 17:16:41 -04:00