So, this is what I\'m talking about: std is complex.
In VS2013 this simple program will cause a deadlock.
#include
#include
You're mixing the platform level with std level. Calling the raw winapi function CreateThread can work in DllMain. But there's no guarantee about how std::thread will interact with the platform. It's well known that it's extremely dangerous to be doing things like this in DllMain, so I don't recommend it at all. If you insist on trying, then you're going to need to tip-toe around and call the winapi directly, avoiding consequences of the std implementation.
As for "why", it shouldn't really matter, but after a very quick look in the debugger, it seems that the MSVC implementation has a handshake with the new thread for exchanging arguments and resources. So it requires synchronization to know when the resources have been handed off. Seems reasonable.