diff src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp @ 1840:4e0094bc41fa

6983311: G1: LoopTest hangs when run with -XX:+ExplicitInvokesConcurrent Summary: Clear the concurrent marking "in progress" flag while the FullGCCount_lock is held. This avoids a race that can cause back to back System.gc() calls, when ExplicitGCInvokesConcurrent is enabled, to fail to initiate a marking cycle causing the requesting thread to hang. Reviewed-by: tonyp, ysr
author johnc
date Fri, 01 Oct 2010 18:23:16 -0700
parents 4e5661ba9d98
children f95d63e2154a
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp	Thu Sep 30 12:15:13 2010 -0700
+++ b/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp	Fri Oct 01 18:23:16 2010 -0700
@@ -303,9 +303,10 @@
 }
 
 void ConcurrentMarkThread::sleepBeforeNextCycle() {
-  clear_in_progress();
   // We join here because we don't want to do the "shouldConcurrentMark()"
   // below while the world is otherwise stopped.
+  assert(!in_progress(), "should have been cleared");
+
   MutexLockerEx x(CGC_lock, Mutex::_no_safepoint_check_flag);
   while (!started()) {
     CGC_lock->wait(Mutex::_no_safepoint_check_flag);