The problem now is that get init using a dummy namespace, then it later initializaes itself! Quite frustrating.
header:
Code:namespace { long nJobInitDummy = SJobInit::init(); };Seems like it gets inited to what I want then inited ti what's above. Anyone know how to resolve this?Code:SBaseQueue<SWJob>* baseQueue = 0; SThreadPool* threadPool = 0; long SJobInit::initStatus = 0; long SJobInit::init() { if(initStatus==0) { initStatus++; baseQueue = new SBaseQueue<SWJob>(1000000); threadPool = new SThreadPool; dout+"job module inited."; dout++; } return 0; }




Reply With Quote