< prev index next >

src/share/vm/gc/g1/vm_operations_g1.cpp

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2001, 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) 2001, 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.
*** 203,229 **** } } } void VM_CGC_Operation::acquire_pending_list_lock() { ! assert(_needs_pll, "don't call this otherwise"); ! // The caller may block while communicating ! // with the SLT thread in order to acquire/release the PLL. ! SurrogateLockerThread* slt = ConcurrentMarkThread::slt(); ! if (slt != NULL) { ! slt->manipulatePLL(SurrogateLockerThread::acquirePLL); ! } else { ! SurrogateLockerThread::report_missing_slt(); ! } } void VM_CGC_Operation::release_and_notify_pending_list_lock() { ! assert(_needs_pll, "don't call this otherwise"); ! // The caller may block while communicating ! // with the SLT thread in order to acquire/release the PLL. ! ConcurrentMarkThread::slt()-> ! manipulatePLL(SurrogateLockerThread::releaseAndNotifyPLL); } void VM_CGC_Operation::doit() { GCIdMark gc_id_mark(_gc_id); GCTraceCPUTime tcpu; --- 203,219 ---- } } } void VM_CGC_Operation::acquire_pending_list_lock() { ! assert(_needs_pending_list_lock, "don't call this otherwise"); ! _pending_list_locker.lock(); } void VM_CGC_Operation::release_and_notify_pending_list_lock() { ! assert(_needs_pending_list_lock, "don't call this otherwise"); ! _pending_list_locker.unlock(); } void VM_CGC_Operation::doit() { GCIdMark gc_id_mark(_gc_id); GCTraceCPUTime tcpu;
*** 234,254 **** } bool VM_CGC_Operation::doit_prologue() { // Note the relative order of the locks must match that in // VM_GC_Operation::doit_prologue() or deadlocks can occur ! if (_needs_pll) { acquire_pending_list_lock(); } - Heap_lock->lock(); return true; } void VM_CGC_Operation::doit_epilogue() { // Note the relative order of the unlocks must match that in // VM_GC_Operation::doit_epilogue() Heap_lock->unlock(); ! if (_needs_pll) { release_and_notify_pending_list_lock(); } } --- 224,243 ---- } bool VM_CGC_Operation::doit_prologue() { // Note the relative order of the locks must match that in // VM_GC_Operation::doit_prologue() or deadlocks can occur ! if (_needs_pending_list_lock) { acquire_pending_list_lock(); } Heap_lock->lock(); return true; } void VM_CGC_Operation::doit_epilogue() { // Note the relative order of the unlocks must match that in // VM_GC_Operation::doit_epilogue() Heap_lock->unlock(); ! if (_needs_pending_list_lock) { release_and_notify_pending_list_lock(); } }
< prev index next >