Is there any way, in Java, to identify uniquely a thread? Using only Thread.getCurrent().getId() isn’t enough since a thread may die and the next one might get its ID. For me, those aren’t the same threads so I need a way to identify them.
The thread creation time stamp would be useful, if I can get it.
What’s wrong with using
==? Or if you need an actual number,System.identityHashCodeis probably a safe bet.