diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java index 9147f2b032d9..abd77c4d4aab 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java @@ -280,9 +280,11 @@ protected void doStop() throws Exception } // Close any un-executed jobs - while (!_jobs.isEmpty()) - { + while (true) { Runnable job = _jobs.poll(); + if (job == null) { + break; + } if (job instanceof Closeable) { try