Duplicate :
|
|
Relates :
|
|
Relates :
|
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; + }
|