So, this is what I\'m talking about: std is complex.
In VS2013 this simple program will cause a deadlock.
#include
#include
std::thread
creates a C++ thread. It means you can rely on the C++ library in that thread. This means certain shared data structures must be set up, which force synchronization (you might create multiple threads in parallel). The stack trace clearly shows this: std::_Cnd_waitX
is clearly a part of the Standard Library, and is clearly synchronizing. Synchronizing is blacklisted in the document you mentioned, so this crash isn't a big surprise.
Further up the stack we see Concurrency::
. This is specific to Visual Studio versions up to VS2015. This means you may luck out in VS2015. Doing thread synchronization in DllMain
is not a guaranteed crash. Just quite possible.