about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
diff options
context:
space:
mode:
authorJosh Simmons <josh@nega.tv>2025-06-26 21:31:05 +0200
committerJosh Simmons <josh@nega.tv>2025-09-30 20:51:03 +0200
commitcbaec31c10c5eff7342e5273360521911fbf7631 (patch)
tree33a55f7bf1bc54bb8da655b0e0df8921cce2bf47 /compiler/rustc_interface/src
parenta2db9280539229a3b8a084a09886670a57bc7e9c (diff)
downloadrust-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