Function current_id
fn current_id() -> ThreadId
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.
Examples
use thread;
let other_thread = spawn;
let other_thread_id = other_thread.join.unwrap;
assert_ne!;