diff --git a/Sources/NIO/BlockingIOThreadPool.swift b/Sources/NIO/BlockingIOThreadPool.swift index 2d0ec74b2b..9335186961 100644 --- a/Sources/NIO/BlockingIOThreadPool.swift +++ b/Sources/NIO/BlockingIOThreadPool.swift @@ -68,7 +68,9 @@ public final class BlockingIOThreadPool { self.lock.withLock { switch self.state { case .running(let items): - items.forEach { $0(.cancelled) } + queue.async { + items.forEach { $0(.cancelled) } + } self.state = .shuttingDown(Array(repeating: true, count: numberOfThreads)) (0..