06-24-2014, 11:07 PM
Actually the cBlockInfoInitializer method fails, because that's the very case that has the non-deterministic startup order. If you have several global classes, C++ provides no means of specifying which of the classes is to be initialized first. If you want specific initialization order, you need to do it like me by using an accessor. Also you need to make sure that the accessor is run before the program goes multithreaded, there's really no way to prevent race conditions in the accessor (because you would need a mutex for that, but you need to initialize the mutex before the accessor -> you need an accessor for the mutex -> loop forever).