-
Notifications
You must be signed in to change notification settings - Fork 287
Closed
Description
I found out that I can't call threadpool
inside class. If I call it in main function in app (like your example) or in dll like this:
void sleep_half_second(const size_t& i, synced_stream* sync_out)
{
std::this_thread::sleep_for(std::chrono::milliseconds(500));
sync_out->println("Task ", i, " done.");
}
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
thread_pool* pool;
synced_stream sync_out;
int i = 1;
pool = new thread_pool(12);
pool->push_task(sleep_half_second, i, &sync_out);
return TRUE;
}
It's OK, doesn't generate error c2064. But if using it in class, it still generates error c2064.
Please help me fix this, I need to call it inside the class
doubleRsi.zip
Thank you very much
Metadata
Metadata
Assignees
Labels
No labels