mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
6983311: G1: LoopTest hangs when run with -XX:+ExplicitInvokesConcurrent
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
This commit is contained in:
parent
603e50f355
commit
20289fbffd
3 changed files with 14 additions and 5 deletions
|
@ -303,9 +303,10 @@ void ConcurrentMarkThread::print_on(outputStream* st) const {
|
|||
}
|
||||
|
||||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue