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

ThreadsSMRSupport::print_info_on() should use try_lock_without_rank_check()

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 17
    • Fix Version/s: 17
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b05
    • CPU:
      generic
    • OS:
      generic

      Description

      The following bug fix changed ThreadsSMRSupport::print_info_on()
      to use try_lock():

          JDK-8231627 ThreadsListHandleInErrorHandlingTest.java fails in printing all threads

      However, it should have skipped the rank check:

      $ git diff
      diff --git a/src/hotspot/share/runtime/threadSMR.cpp b/src/hotspot/share/runtime/threadSMR.cpp
      index 9b70bdf753c..1ed8ac04246 100644
      --- a/src/hotspot/share/runtime/threadSMR.cpp
      +++ b/src/hotspot/share/runtime/threadSMR.cpp
      @@ -1107,7 +1107,7 @@ void ThreadsSMRSupport::print_info_on(const Thread* thread, outputStream* st) {
       // Print Threads class SMR info.
       void ThreadsSMRSupport::print_info_on(outputStream* st) {
         bool needs_unlock = false;
      - if (Threads_lock->try_lock()) {
      + if (Threads_lock->try_lock_without_rank_check()) {
           // We were able to grab the Threads_lock which makes things safe for
           // this call, but if we are error reporting, then a nested error
           // could happen with the Threads_lock held.


        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dcubed Daniel Daugherty
              Reporter:
              dcubed Daniel Daugherty
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: