I have this class
class MyTask
{
public:
// Function to be executed by thread function
void run()
{
std::cout << "Task Start" << std::endl;
// Check if thread is requested to stop ?
while (stopRequested() == false)
{
std::cout << "Doing Some Work" << std::endl;
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
}
std::cout << "Task End" << std::endl;
}
};
I do
MyTask task; ctpl::thread_pool testThreadPool(4);
How can I push task.run() to ctpl::thread_pool?
testThreadPool.push(task.run);, isn't correct
I have this class
I do
MyTask task; ctpl::thread_pool testThreadPool(4);How can I push
task.run()toctpl::thread_pool?testThreadPool.push(task.run);, isn't correct