So, this is what I\'m talking about: std is complex.
In VS2013 this simple program will cause a deadlock.
#include
#include
Use detach()
member function to fix the crash. Example:
void Hook_Init();
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
{
std::thread hookthread(Hook_Init);
hookthread.detach();
break;
}
}
return TRUE;
}
void Hook_Init()
{
// Code
}