See this discussion thread. http://cs.oswego.edu/pipermail/concurrency-interest/2013-June/011440.html
The problem is that Thread.getId() can be overridden in subclasses and the value can be altered. Classes such as RecursiveReadersWriterLock (RRWL) depends upon getId() returning a unique value for each Thread. If this doesn't hold, then RRWL will be broken.
The recommendation is that getId() be deprecated and a new final method be created such as getFinalId(), getImmutableId(), getFirmId(), or getStableId().
The problem is that Thread.getId() can be overridden in subclasses and the value can be altered. Classes such as RecursiveReadersWriterLock (RRWL) depends upon getId() returning a unique value for each Thread. If this doesn't hold, then RRWL will be broken.
The recommendation is that getId() be deprecated and a new final method be created such as getFinalId(), getImmutableId(), getFirmId(), or getStableId().
- relates to
-
JDK-8017739 ReentrantReadWriteLock is confused by the Threads with reused IDs
- Closed