diff options
| author | Eduardo Sánchez Muñoz <esm@eduardosm.net> | 2020-05-26 17:38:22 +0200 |
|---|---|---|
| committer | Eduardo Sánchez Muñoz <esm@eduardosm.net> | 2020-05-26 17:46:10 +0200 |
| commit | f03cf9916a1932f47b788a9de9256269cc172fe9 (patch) | |
| tree | 6ae5e84172fdf68053b59f8b8f1f641af50d3bf7 /src/rustllvm/CoverageMappingWrapper.cpp | |
| parent | cb272d5d21c94f9a460d68d76817227a5913fbf7 (diff) | |
| download | rust-f03cf9916a1932f47b788a9de9256269cc172fe9.tar.gz rust-f03cf9916a1932f47b788a9de9256269cc172fe9.zip | |
Add a fast path for `std::thread::panicking`.
This is done by adding a global atomic variable (non-TLS) that counts how many threads are panicking. In order to check if the current thread is panicking, this variable is read and, if it is zero, no thread (including the one where `panicking` is being called) is panicking and `panicking` can return `false` immediately without needing to access TLS. If the global counter is not zero, the local counter is accessed from TLS to check if the current thread is panicking.
Diffstat (limited to 'src/rustllvm/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
