#pthreads #integer-id

gettid

Helper to get an integer ID for the current thread

5 releases

0.1.4 Aug 20, 2025
0.1.3 Jun 21, 2024
0.1.2 Jun 25, 2020
0.1.1 Feb 20, 2020
0.1.0 May 4, 2019

#1 in #integer-id

Download history 25474/week @ 2025-10-17 22855/week @ 2025-10-24 18351/week @ 2025-10-31 17453/week @ 2025-11-07 20053/week @ 2025-11-14 18400/week @ 2025-11-21 17444/week @ 2025-11-28 24443/week @ 2025-12-05 19323/week @ 2025-12-12 15459/week @ 2025-12-19 8612/week @ 2025-12-26 17086/week @ 2026-01-02 23346/week @ 2026-01-09 21346/week @ 2026-01-16 21880/week @ 2026-01-23 27808/week @ 2026-01-30

100,253 downloads per month
Used in 4 crates (3 directly)

0BSD license

4KB

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);

Dependencies

~42KB