pub fn gettid() -> u64
Expand description
Get the current thread’s thread id.
use gettid::gettid;
let main_tid = gettid();
let pid = std::process::id();
assert_eq!(pid as u64, main_tid);
let thread_tid = std::thread::spawn(gettid).join().unwrap();
assert_ne!(main_tid, thread_tid);