pub fn current_id() -> ThreadId
🔬This is a nightly-only experimental API. (
current_thread_id
#147194)Expand description
Gets the unique identifier of the thread which invokes it.
Calling this function may be more efficient than accessing the current
thread id through the current thread handle. i.e. thread::current().id()
.
This function will always succeed, will always return the same value for one thread and is guaranteed not to call the global allocator.