Thread guard that only gives access to the contained value on the thread it was created on.
Returns a unique ID for the current thread.