From 3a75e92b15336cdd068b5ae404b5034ea92c76ea Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Wed, 4 May 2022 04:55:27 +0000 Subject: [PATCH] 8286063: check compiler queue after calling AbstractCompiler::on_empty_queue Reviewed-by: kvn --- src/hotspot/share/compiler/compileBroker.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hotspot/share/compiler/compileBroker.cpp b/src/hotspot/share/compiler/compileBroker.cpp index 3897d70490d..b715f7783d5 100644 --- a/src/hotspot/share/compiler/compileBroker.cpp +++ b/src/hotspot/share/compiler/compileBroker.cpp @@ -440,6 +440,11 @@ CompileTask* CompileQueue::get(CompilerThread* thread) { AbstractCompiler* compiler = thread->compiler(); guarantee(compiler != nullptr, "Compiler object must exist"); compiler->on_empty_queue(this, thread); + if (_first != nullptr) { + // The call to on_empty_queue may have temporarily unlocked the MCQ lock + // so check again whether any tasks were added to the queue. + break; + } // If there are no compilation tasks and we can compile new jobs // (i.e., there is enough free space in the code cache) there is