comparison src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp @ 2365:a181f3a124dd

6987703: iCMS: Intermittent hang with gc/gctests/CallGC/CallGC01 and +ExplicitGCInvokesConcurrent Summary: Count enable_icms() and disable_icms() events so as to prevent inteference between concurrent calls, which can cause the iCMS thread to be left stranded in icms_wait() with an unserviced request and no young allocations to unwedge it. Reviewed-by: jcoomes, poonam
author ysr
date Mon, 14 Mar 2011 21:52:24 -0700
parents c5a923563727
children 92da084fefc9
comparison
equal deleted inserted replaced
2364:04d1138b4cce 2365:a181f3a124dd
1 /* 1 /*
2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
1687 unsigned int gc_count = gch->total_full_collections(); 1687 unsigned int gc_count = gch->total_full_collections();
1688 if (gc_count == full_gc_count) { 1688 if (gc_count == full_gc_count) {
1689 MutexLockerEx y(CGC_lock, Mutex::_no_safepoint_check_flag); 1689 MutexLockerEx y(CGC_lock, Mutex::_no_safepoint_check_flag);
1690 _full_gc_requested = true; 1690 _full_gc_requested = true;
1691 CGC_lock->notify(); // nudge CMS thread 1691 CGC_lock->notify(); // nudge CMS thread
1692 } else {
1693 assert(gc_count > full_gc_count, "Error: causal loop");
1692 } 1694 }
1693 } 1695 }
1694 1696
1695 1697
1696 // The foreground and background collectors need to coordinate in order 1698 // The foreground and background collectors need to coordinate in order