about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
diff options
context:
space:
mode:
authorjoboet <jonasboettiger@icloud.com>2024-11-25 13:01:35 +0100
committerjoboet <jonasboettiger@icloud.com>2025-01-14 13:37:28 +0100
commit14f7f4b7bfcfbfe9a6f778e762cac83420e08007 (patch)
tree90265fd148d36907b20072e05ced8406d520206f /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
parent0e5ee891b2b07321175e398153bfa86c667f3494 (diff)
downloadrust-14f7f4b7bfcfbfe9a6f778e762cac83420e08007.tar.gz
rust-14f7f4b7bfcfbfe9a6f778e762cac83420e08007.zip
std: lazily allocate the main thread handle
Thereby, we also allow accessing thread::current before main: as the runtime no longer tries to install its own handle, this will no longer trigger an abort. Rather, the name returned from name will only be "main" after the runtime initialization code has run, but I think that is acceptable.

This new approach also requires some changes to the signal handling code, as calling `thread::current` would now allocate when called on the main thread, which is not acceptable. I fixed this by adding a new function (`with_current_name`) that performs all the naming logic without allocation or without initializing the thread ID (which could allocate on some platforms).
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions