8043158: Crash in CodeSweeperSweepNoFlushTest in CompileQueue::free_all()

Acquire lock before calling notify()

Reviewed-by: twisti, thartmann
This commit is contained in:
Albert Noll 2014-06-20 09:25:13 +02:00
parent 2626aed785
commit 1319cf1a68

View File

@ -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);
}