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

Missing termination check results violation of termination invariant

XMLWordPrintable

    • gc
    • b06
    • Not verified


        diff --git a/src/hotspot/share/gc/shared/owstTaskTerminator.cpp b/src/hotspot/share/gc/shared/owstTaskTerminator.cpp
        --- a/src/hotspot/share/gc/shared/owstTaskTerminator.cpp
        +++ b/src/hotspot/share/gc/shared/owstTaskTerminator.cpp

        @@ -59,21 +61,31 @@
         
               if (do_spin_master_work(terminator)) {
                 assert(_offered_termination == _n_threads, "termination condition");
        + assert(!peek_in_queue_set(), "Precondition");
                 return true;
               } else {
                 _blocker->lock_without_safepoint_check();
        + // There is possibility that termination is reached between dropping the lock
        + // before returning from do_spin_master() and acquiring lock above.
        + if (_offered_termination == _n_threads) {
        + _blocker->unlock();
        + assert(!peek_in_queue_set(), "Precondition");
        + return true;
        + }

              zgu Zhengyu Gu
              zgu Zhengyu Gu
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: