# HG changeset patch # User anoll # Date 1403249113 -7200 # Node ID 28051f14c3283a9195e442a113eb5211c6116c2b # Parent c47fcf523fff21b5964fd631d683b06dec731f6a 8043158: Crash in CodeSweeperSweepNoFlushTest in CompileQueue::free_all() Summary: Acquire lock before calling notify() Reviewed-by: twisti, thartmann diff -r c47fcf523fff -r 28051f14c328 src/share/vm/compiler/compileBroker.cpp --- a/src/share/vm/compiler/compileBroker.cpp Tue May 06 09:52:38 2014 +0200 +++ b/src/share/vm/compiler/compileBroker.cpp Fri Jun 20 09:25:13 2014 +0200 @@ -678,8 +678,11 @@ 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); }