You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// I can see "myFunction() running". But my logic never starts to execute.
void myFunction()
{
std::cout << "myFunction() running" << std::endl;
while(1)
{
// some logic...
}
}
thread_pool->enqueue([]()
{
myFunction();
});
I created a thread myself to run my function, and it succeeded. So, that should not be the problem of my funtion, maybe there's a bug or something in the threadpool?
The text was updated successfully, but these errors were encountered:
what's your num thread argument value ? if you set it to 1, then you will get stuck, because all the task will run in one thread, so that they will run one by one.
The thread is running well when the function is simple. However, I encountered a stuck thread using my own function. Here is a simple example.
I created a thread myself to run my function, and it succeeded. So, that should not be the problem of my funtion, maybe there's a bug or something in the threadpool?
The text was updated successfully, but these errors were encountered: