Mercurial > hg > graal-compiler
comparison 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 |
comparison
equal
deleted
inserted
replaced
1838:8f6f7587d292 | 1840:4e0094bc41fa |
---|---|
301 Thread::print_on(st); | 301 Thread::print_on(st); |
302 st->cr(); | 302 st->cr(); |
303 } | 303 } |
304 | 304 |
305 void ConcurrentMarkThread::sleepBeforeNextCycle() { | 305 void ConcurrentMarkThread::sleepBeforeNextCycle() { |
306 clear_in_progress(); | |
307 // We join here because we don't want to do the "shouldConcurrentMark()" | 306 // We join here because we don't want to do the "shouldConcurrentMark()" |
308 // below while the world is otherwise stopped. | 307 // below while the world is otherwise stopped. |
308 assert(!in_progress(), "should have been cleared"); | |
309 | |
309 MutexLockerEx x(CGC_lock, Mutex::_no_safepoint_check_flag); | 310 MutexLockerEx x(CGC_lock, Mutex::_no_safepoint_check_flag); |
310 while (!started()) { | 311 while (!started()) { |
311 CGC_lock->wait(Mutex::_no_safepoint_check_flag); | 312 CGC_lock->wait(Mutex::_no_safepoint_check_flag); |
312 } | 313 } |
313 set_in_progress(); | 314 set_in_progress(); |