You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of #143069 - jsimmons:current-thread-id-accessor, r=joshtriplett,tgross35
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 shared 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.
edit: ACP: rust-lang/libs-team#650
0 commit comments