about summary refs log tree commit diff
path: root/src/rustllvm/CoverageMappingWrapper.cpp
diff options
context:
space:
mode:
authorEduardo Sánchez Muñoz <esm@eduardosm.net>2020-05-26 17:38:22 +0200
committerEduardo Sánchez Muñoz <esm@eduardosm.net>2020-05-26 17:46:10 +0200
commitf03cf9916a1932f47b788a9de9256269cc172fe9 (patch)
tree6ae5e84172fdf68053b59f8b8f1f641af50d3bf7 /src/rustllvm/CoverageMappingWrapper.cpp
parentcb272d5d21c94f9a460d68d76817227a5913fbf7 (diff)
downloadrust-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