From 1319cf1a68df68f7ecf14cc9b525182977946fd2 Mon Sep 17 00:00:00 2001 From: Albert Noll Date: Fri, 20 Jun 2014 09:25:13 +0200 Subject: [PATCH] 8043158: Crash in CodeSweeperSweepNoFlushTest in CompileQueue::free_all() Acquire lock before calling notify() Reviewed-by: twisti, thartmann --- hotspot/src/share/vm/compiler/compileBroker.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp index ff292fbd747..d062c7085c4 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.cpp +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp @@ -639,8 +639,11 @@ void CompileQueue::free_all() { while (next != NULL) { CompileTask* current = next; next = current->next(); - // Wake up thread that blocks on the compile task. - current->lock()->notify(); + { + // Wake up thread that blocks on the compile task. + MutexLocker ct_lock(current->lock()); + current->lock()->notify(); + } // Put the task back on the freelist. CompileTask::free(current); }