Skip to content

Commit

Permalink
HTTPServer Applications Slow to Terminate #3796 (#3797)
Browse files Browse the repository at this point in the history
- 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>
  • Loading branch information
sbalousek authored and aleks-f committed Oct 23, 2023
1 parent 79be4ea commit 54fa720
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Net/src/TCPServerDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,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);
}
}


Expand Down

0 comments on commit 54fa720

Please sign in to comment.