# HG changeset patch # User coleenp # Date 1565018208 14400 # Node ID c38cca5ffb6655cdfddb8274d05f8baf76ebe39f # Parent e7acf5388c29a367955d266f9f49354a57e4a463 8229000: Fix lock and reenable assert in Monitor::check_safepoint_state Reviewed-by: dholmes, kbarrett diff -r e7acf5388c29 -r c38cca5ffb66 src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp --- a/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp Mon Aug 05 11:11:18 2019 +0530 +++ b/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp Mon Aug 05 11:16:48 2019 -0400 @@ -6969,7 +6969,7 @@ } ConcurrentMarkSweepThread::synchronize(true); - bml->lock(); + bml->lock_without_safepoint_check(); _collector->startTimer(); } diff -r e7acf5388c29 -r c38cca5ffb66 src/hotspot/share/runtime/mutex.cpp --- a/src/hotspot/share/runtime/mutex.cpp Mon Aug 05 11:11:18 2019 +0530 +++ b/src/hotspot/share/runtime/mutex.cpp Mon Aug 05 11:16:48 2019 -0400 @@ -40,6 +40,10 @@ assert(!thread->is_Java_thread() || _safepoint_check_required != not_allowed, "This lock should %s have a safepoint check for Java threads: %s", _safepoint_check_required ? "always" : "never", name()); + + // If defined with safepoint_check_never, a NonJavaThread should never ask to safepoint check either. + assert(thread->is_Java_thread() || !do_safepoint_check || _safepoint_check_required != Monitor::_safepoint_check_never, + "NonJavaThread should not check for safepoint"); } #endif // ASSERT