< prev index next >

src/share/vm/gc/cms/vmCMSOperations.cpp

Print this page

        

@@ -35,18 +35,10 @@
 #include "utilities/dtrace.hpp"
 
 //////////////////////////////////////////////////////////
 // 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) {
     GCTraceTime(Info, gc, phases, verify) tm("Verify Before", _collector->_gc_timer_cm);
     HandleMark hm;

@@ -83,21 +75,14 @@
   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;
   }
   return _prologue_succeeded;
 }

@@ -106,15 +91,14 @@
   assert(Thread::current()->is_ConcurrentGC_thread(), "just checking");
   assert(!CMSCollector::foregroundGCShouldWait(), "Possible deadlock");
   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();
+  if (Universe::has_reference_pending_list()) {
+    Heap_lock->notify_all();
   }
+  Heap_lock->unlock();
 }
 
 //////////////////////////////////////////////////////////
 // Methods in class VM_CMS_Initial_Mark
 //////////////////////////////////////////////////////////

@@ -228,13 +212,15 @@
 
 void VM_GenCollectFullConcurrent::doit_epilogue() {
   Thread* thr = Thread::current();
   assert(thr->is_Java_thread(), "just checking");
   JavaThread* jt = (JavaThread*)thr;
-  // Release the Heap_lock first.
+
+  if (Universe::has_reference_pending_list()) {
+    Heap_lock->notify_all();
+  }
   Heap_lock->unlock();
-  release_and_notify_pending_list_lock();
 
   // It is fine to test whether completed collections has
   // exceeded our request count without locking because
   // the completion count is monotonically increasing;
   // this will break for very long-running apps when the
< prev index next >