Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8017617

(thread) Deprecate and provide alternative to Thread.getId()

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 6, 7, 7u40, 8
    • core-libs
    • None
    • generic
    • generic

      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().

            alanb Alan Bateman
            nreynold Nathan Reynolds
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: