thread::id

thread::id

Returns the ID of the current thread. This ID is not guaranteed to be usable anywhere except in the thread package in the current process.