multithreading - How to identify a thread uniquely in Java? -
Is there any way, in Java, to identify specific threads? Using only thread.strust (). GetId () is not enough because one thread can die and the next one can get its ID. For me, these are not the same thread, so they need a way of recognizing them. The timestamp for creating threads will be useful if I can get it. What is wrong to use == ? Or if you need a real number, then maybe there is a safe bet.