We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2fadc13 + 2a070ed commit 494db8fCopy full SHA for 494db8f
src/main/java/org/jboss/threads/EnhancedQueueExecutor.java
@@ -956,7 +956,10 @@ public void shutdown(boolean interrupt) {
956
// a marker to indicate that termination was requested
957
for (;;) {
958
tailNext = tail.getNext();
959
- if (tailNext instanceof TaskNode) {
+ if (tailNext == tail) {
960
+ // we raced with shutdownNow, and now we're in a pickle! re-get tail & retry
961
+ tail = getTail();
962
+ } else if (tailNext instanceof TaskNode) {
963
tail = (TaskNode) tailNext;
964
} else if (tailNext instanceof PoolThreadNode || tailNext == null) {
965
// remove the entire chain from this point
0 commit comments