HTTPServer Applications Slow to Terminate #3796 (#3797)

- Queue a StopNotification for each thread in the TCPServerDispatcher thread pool. Otherwise, only one thread in the thread pool is terminated.

Signed-off-by: Stephen Balousek <sbalousek@wickedloop.com>
This commit is contained in:
Stephen Balousek
2022-09-11 10:30:02 -07:00
committed by GitHub
parent 1fcbfc6094
commit 1181fb2485

View File

@@ -173,7 +173,10 @@ void TCPServerDispatcher::stop()
FastMutex::ScopedLock lock(_mutex);
_stopped = true;
_queue.clear();
_queue.enqueueNotification(new StopNotification);
for (int i = 0; i < _threadPool.allocated(); i++)
{
_queue.enqueueNotification(new StopNotification);
}
}