Skip to content

Commit 1181fb2

Browse files
authored
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 <[email protected]>
1 parent 1fcbfc6 commit 1181fb2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Net/src/TCPServerDispatcher.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,10 @@ void TCPServerDispatcher::stop()
173173
FastMutex::ScopedLock lock(_mutex);
174174
_stopped = true;
175175
_queue.clear();
176-
_queue.enqueueNotification(new StopNotification);
176+
for (int i = 0; i < _threadPool.allocated(); i++)
177+
{
178+
_queue.enqueueNotification(new StopNotification);
179+
}
177180
}
178181

179182

0 commit comments

Comments
 (0)