diff options
| author | Josh Stone <jistone@redhat.com> | 2022-06-09 11:51:39 -0700 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2022-06-09 11:51:39 -0700 |
| commit | 34895ded2c76cc87dc6ff33adaa541c239d416bf (patch) | |
| tree | 2dce32a0db8647be4ac6fd4af490cdc6792e639c /src/librustdoc/html/static/js/source-script.js | |
| parent | a0411e2bfe1fb939757aa96603f0a10d1d9eb029 (diff) | |
| download | rust-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 'src/librustdoc/html/static/js/source-script.js')
0 files changed, 0 insertions, 0 deletions
