< prev index next >
src/share/vm/gc/cms/vmCMSOperations.cpp
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 36,60 ****
//////////////////////////////////////////////////////////
// Methods in abstract class VM_CMS_Operation
//////////////////////////////////////////////////////////
void VM_CMS_Operation::acquire_pending_list_lock() {
! // The caller may block while communicating
! // with the SLT thread in order to acquire/release the PLL.
! SurrogateLockerThread* slt = ConcurrentMarkSweepThread::slt();
! if (slt != NULL) {
! slt->manipulatePLL(SurrogateLockerThread::acquirePLL);
! } else {
! SurrogateLockerThread::report_missing_slt();
! }
}
void VM_CMS_Operation::release_and_notify_pending_list_lock() {
! // The caller may block while communicating
! // with the SLT thread in order to acquire/release the PLL.
! ConcurrentMarkSweepThread::slt()->
! manipulatePLL(SurrogateLockerThread::releaseAndNotifyPLL);
}
void VM_CMS_Operation::verify_before_gc() {
if (VerifyBeforeGC &&
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
--- 36,50 ----
//////////////////////////////////////////////////////////
// Methods in abstract class VM_CMS_Operation
//////////////////////////////////////////////////////////
void VM_CMS_Operation::acquire_pending_list_lock() {
! _pending_list_locker.lock();
}
void VM_CMS_Operation::release_and_notify_pending_list_lock() {
! _pending_list_locker.unlock();
}
void VM_CMS_Operation::verify_before_gc() {
if (VerifyBeforeGC &&
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
*** 93,111 ****
assert(Thread::current()->is_ConcurrentGC_thread(), "just checking");
assert(!CMSCollector::foregroundGCShouldWait(), "Possible deadlock");
assert(!ConcurrentMarkSweepThread::cms_thread_has_cms_token(),
"Possible deadlock");
! if (needs_pll()) {
acquire_pending_list_lock();
}
// Get the Heap_lock after the pending_list_lock.
Heap_lock->lock();
if (lost_race()) {
assert(_prologue_succeeded == false, "Initialized in c'tor");
Heap_lock->unlock();
! if (needs_pll()) {
release_and_notify_pending_list_lock();
}
} else {
_prologue_succeeded = true;
}
--- 83,101 ----
assert(Thread::current()->is_ConcurrentGC_thread(), "just checking");
assert(!CMSCollector::foregroundGCShouldWait(), "Possible deadlock");
assert(!ConcurrentMarkSweepThread::cms_thread_has_cms_token(),
"Possible deadlock");
! if (needs_pending_list_lock()) {
acquire_pending_list_lock();
}
// Get the Heap_lock after the pending_list_lock.
Heap_lock->lock();
if (lost_race()) {
assert(_prologue_succeeded == false, "Initialized in c'tor");
Heap_lock->unlock();
! if (needs_pending_list_lock()) {
release_and_notify_pending_list_lock();
}
} else {
_prologue_succeeded = true;
}
*** 118,128 ****
assert(!ConcurrentMarkSweepThread::cms_thread_has_cms_token(),
"Possible deadlock");
// Release the Heap_lock first.
Heap_lock->unlock();
! if (needs_pll()) {
release_and_notify_pending_list_lock();
}
}
//////////////////////////////////////////////////////////
--- 108,118 ----
assert(!ConcurrentMarkSweepThread::cms_thread_has_cms_token(),
"Possible deadlock");
// Release the Heap_lock first.
Heap_lock->unlock();
! if (needs_pending_list_lock()) {
release_and_notify_pending_list_lock();
}
}
//////////////////////////////////////////////////////////
< prev index next >