gettid

Crates.iogettid
lib.rsgettid
version0.1.4
created_at2019-05-04 00:28:49.197555+00
updated_at2025-08-20 10:55:00.602773+00
descriptionHelper to get an integer ID for the current thread
homepage
repositoryhttps://github.com/jmgao/gettid
max_upload_size
id131842
size6,224
Josh Gao (jmgao)

documentation

README

gettid

A crate to help with fetching thread IDs across multiple platforms.

use gettid::gettid;

let main_tid = gettid();
let pid = std::process::id();
let thread_tid = std::thread::spawn(gettid).join().unwrap();
assert_ne!(main_tid, thread_tid);
Commit count: 22

cargo fmt