ThreadFactory used by Thread.Builder::factory uses non-optimal VarHandle

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 26
    • Affects Version/s: 19, 26
    • Component/s: core-libs
    • master

      Submitting on behalf of Francesco Nigro:

      https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Thread.Builder.html#name(java.lang.String,long) enable users to create named Thread(s), but the existing code is passing an integer constant type to a VarHandle on a long field, which is sensitive to its signature type and causing it to not be correctly optimized.

            Assignee:
            Alan Bateman
            Reporter:
            Galder ZamarreƱo
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: