8043158: Crash in CodeSweeperSweepNoFlushTest in CompileQueue::free_all()
authoranoll
Fri, 20 Jun 2014 09:25:13 +0200
changeset 25339 ca74d9691341
parent 25338 8afcbcb8271a
child 25340 cecf01c76a9e
child 25341 0d93ff60f047
8043158: Crash in CodeSweeperSweepNoFlushTest in CompileQueue::free_all() Summary: Acquire lock before calling notify() Reviewed-by: twisti, thartmann
hotspot/src/share/vm/compiler/compileBroker.cpp
--- a/hotspot/src/share/vm/compiler/compileBroker.cpp	Fri Jun 20 08:14:30 2014 +0200
+++ b/hotspot/src/share/vm/compiler/compileBroker.cpp	Fri Jun 20 09:25:13 2014 +0200
@@ -639,8 +639,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);
   }