diff options
| author | Josh Simmons <josh@nega.tv> | 2025-06-26 21:31:05 +0200 |
|---|---|---|
| committer | Josh Simmons <josh@nega.tv> | 2025-09-30 20:51:03 +0200 |
| commit | cbaec31c10c5eff7342e5273360521911fbf7631 (patch) | |
| tree | 33a55f7bf1bc54bb8da655b0e0df8921cce2bf47 /compiler/rustc_interface/src | |
| parent | a2db9280539229a3b8a084a09886670a57bc7e9c (diff) | |
| download | rust-cbaec31c10c5eff7342e5273360521911fbf7631.tar.gz rust-cbaec31c10c5eff7342e5273360521911fbf7631.zip | |
Add fast-path for accessing the current thread id
Accessing the thread id is often used in profiling and debugging, as well as some approaches for sound single-threaded access to data. Currently the only way to access the thread id is by first obtaining a handle to the current thread. While this is not exactly slow, it does require an atomic inc-ref and dec-ref operation, as well as the injection of `Thread`'s drop code into the caller. This publicly exposes the existing fast-path for accessing the current thread id.
Diffstat (limited to 'compiler/rustc_interface/src')
0 files changed, 0 insertions, 0 deletions
