glib::thread_guard

Function thread_id

Source
pub fn thread_id() -> usize
Expand description

Returns a unique ID for the current thread.

Actual thread IDs can be reused by the OS once the old thread finished. This works around ambiguity created by ID reuse by using a separate TLS counter for threads.