changeset 56426:c38cca5ffb66

8229000: Fix lock and reenable assert in Monitor::check_safepoint_state Reviewed-by: dholmes, kbarrett
author coleenp
date Mon, 05 Aug 2019 11:16:48 -0400
parents e7acf5388c29
children b5ab9a71aa95
files src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp src/hotspot/share/runtime/mutex.cpp
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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();
 }
--- 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