changeset 6401:8fddb780f3a7

8042570: Excessive number of tests timing out on nightly testing due to fix for 8040798 Summary: Remove unnecessary lock in CompileBroker::mark_on_stack() that causes the deadlock Reviewed-by: kvn, dcubed
author anoll
date Wed, 07 May 2014 22:06:42 +0200
parents b5e1deb7279e
children 2377269bd73d
files src/share/vm/compiler/compileBroker.cpp
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/compiler/compileBroker.cpp	Fri May 02 14:53:06 2014 +0200
+++ b/src/share/vm/compiler/compileBroker.cpp	Wed May 07 22:06:42 2014 +0200
@@ -1062,15 +1062,16 @@
 
 /**
  * Set the methods on the stack as on_stack so that redefine classes doesn't
- * reclaim them
+ * reclaim them. This method is executed at a safepoint.
  */
 void CompileBroker::mark_on_stack() {
+  assert(SafepointSynchronize::is_at_safepoint(), "sanity check");
+  // Since we are at a safepoint, we do not need a lock to access
+  // the compile queues.
   if (_c2_compile_queue != NULL) {
-    MutexLocker locker(_c2_compile_queue->lock());
     _c2_compile_queue->mark_on_stack();
   }
   if (_c1_compile_queue != NULL) {
-    MutexLocker locker(_c1_compile_queue->lock());
     _c1_compile_queue->mark_on_stack();
   }
 }