18#include <trantor/exports.h>
78 std::string queueName_;
80 std::queue<std::function<void()>> taskQueue_;
81 std::vector<std::thread> threads_;
83 std::mutex taskMutex_;
84 std::condition_variable taskCond_;
85 std::atomic_bool stop_;
86 void queueFunc(
int queueNum);
size_t getTaskCount()
Get the number of tasks to be executed in the queue.
ConcurrentTaskQueue(size_t threadNum, const std::string &name)
Construct a new concurrent task queue instance.
void stop()
Stop all threads in the queue.
virtual std::string getName() const
Get the name of the queue.
Definition ConcurrentTaskQueue.h:56
virtual void runTaskInQueue(const std::function< void()> &task)
Run a task in the queue.
This class is a pure virtual class that can be implemented as a SerialTaskQueue or a ConcurrentTaskQu...
Definition TaskQueue.h:29
Definition EventLoop.h:34