In short, I would like a particular piece of static initialization to occur as close to the beginning of main()/DllMain() as possible. It would probably be acceptable for this to be a constructor called last during static initialization.
Since this will almost certainly be a compiler-specific implementation, I'm specifically looking to do this using the visual C++ compiler (VS 2010 and beyond). In the future I will probably need to do this in GCC and Clang, but that's not an immediate concern.
The long story is I have a object in a base library that is statically initialized and creates a thread in its constructor. This thread relies on other statically initialized objects in libraries that we don't control so it causes a race condition in static initialization. If I can pause or avoid creating the thread until all other static initialization is complete this should fix the problem (a simple Sleep(5000) avoids the issue, though that's not exactly a robust solution).
I could explicitly call an initialize function in our main() function, however this isn't ideal as we have 20+ binaries that use this library so every programmer would have to remember to run the initialization in every binary. I would prefer to push this responsibility to the compiler if possible.