Renave queue_adjust to on_idle (#442)

This commit is contained in:
yhirose 2020-04-25 17:56:22 -04:00
parent 5928e0af1a
commit d359e3a5f7

View file

@ -367,9 +367,11 @@ class TaskQueue {
public:
TaskQueue() = default;
virtual ~TaskQueue() = default;
virtual void enqueue(std::function<void()> fn) = 0;
virtual void queue_adjust() { };
virtual void shutdown() = 0;
virtual void on_idle(){};
};
class ThreadPool : public TaskQueue {
@ -3498,7 +3500,7 @@ inline bool Server::listen_internal() {
auto val = detail::select_read(svr_sock_, 0, 100000);
if (val == 0) { // Timeout
task_queue->queue_adjust();
task_queue->on_idle();
continue;
}