From 3073f25b0d4226a89e8fe157b716ca71ddc72c4f Mon Sep 17 00:00:00 2001 From: Albert Noll Date: Wed, 7 May 2014 22:06:42 +0200 Subject: [PATCH] 8042570: Excessive number of tests timing out on nightly testing due to fix for 8040798 Remove unnecessary lock in CompileBroker::mark_on_stack() that causes the deadlock Reviewed-by: kvn, dcubed --- hotspot/src/share/vm/compiler/compileBroker.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp index 6f3b416cbd8..8521806cd1f 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.cpp +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp @@ -1062,15 +1062,16 @@ void CompileBroker::init_compiler_threads(int c1_compiler_count, int c2_compiler /** * 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(); } }