Skip to main content

current_tid

Function current_tid 

Source
pub fn current_tid() -> u32
Available on Android or Linux only.
Expand description

OS thread ID (tid) of the calling thread.

gettid() on Linux/Android (a vDSO/syscall); a stable per-thread counter elsewhere. Allocation-free, so it is safe to call from the allocator hook. On hot paths prefer cached_tid, which pays the syscall once per thread.