Issue #7650 - Fix race condition when stopping QueuedThreadPool (#9325)

* Issue #7650 - Fix race condition when stopping QueuedThreadPool

Signed-off-by: Dominik Zöchbauer <dominik@zoechbauer.info>
Co-authored-by: Greg Wilkins <gregw@webtide.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Dominik Zöchbauer 2023-02-08 10:27:14 +01:00 committed by GitHub
parent 0a4a077819
commit 40f7fc8510
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -288,9 +288,11 @@ public class QueuedThreadPool extends ContainerLifeCycle implements ThreadFactor
}
// Close any un-executed jobs
while (!_jobs.isEmpty())
while (true)
{
Runnable job = _jobs.poll();
if (job == null)
break;
if (job instanceof Closeable)
{
try