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

ThreadsSMRSupport::print_info_on() should use try_lock_without_rank_check()

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 17
    • 17
    • hotspot
    • None
    • b05
    • generic
    • generic

      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.


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

              Created:
              Updated:
              Resolved: