< prev index next >
src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp
Print this page
@@ -1708,14 +1708,13 @@
assert(Thread::current()->is_ConcurrentGC_thread(),
"A CMS asynchronous collection is only allowed on a CMS thread.");
CMSHeap* heap = CMSHeap::heap();
{
- bool safepoint_check = Mutex::_no_safepoint_check_flag;
- MutexLockerEx hl(Heap_lock, safepoint_check);
+ MutexLocker hl(Heap_lock);
FreelistLocker fll(this);
- MutexLockerEx x(CGC_lock, safepoint_check);
+ MutexLockerEx x(CGC_lock, Mutex::_no_safepoint_check_flag);
if (_foregroundGCIsActive) {
// The foreground collector is. Skip this
// background collection.
assert(!_foregroundGCShouldWait, "Should be clear");
return;
@@ -1855,11 +1854,11 @@
// Don't move the call to compute_new_size() down
// into code that might be executed if the background
// collection was preempted.
{
ReleaseForegroundGC x(this); // unblock FG collection
- MutexLockerEx y(Heap_lock, Mutex::_no_safepoint_check_flag);
+ MutexLocker y(Heap_lock);
CMSTokenSync z(true); // not strictly needed.
if (_collectorState == Resizing) {
compute_new_size();
save_heap_summary();
_collectorState = Resetting;
@@ -7956,11 +7955,11 @@
}
void CMSCollector::par_preserve_mark_if_necessary(oop p) {
markOop m = p->mark_raw();
if (m->must_be_preserved(p)) {
- MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag);
+ MutexLocker x(ParGCRareEvent_lock);
// Even though we read the mark word without holding
// the lock, we are assured that it will not change
// because we "own" this oop, so no other thread can
// be trying to push it on the overflow list; see
// the assertion in preserve_mark_work() that checks
< prev index next >