#include "SimHost.h" #include #include #include // System includes #include #ifdef _WIN32 #include #define getpid() _getpid() #else #include #endif // App includes SimHost::SimHost() { OSG_ALWAYS<<"SimHost instantiated."< threadObject = new ThreadedWorker(); osg::ref_ptr IGCon = new IGConnector(); threadObject->setThreadWorker(IGCon); _threadObjects.push_back(threadObject); _IGConnectors.push_back(IGCon); } OSG_ALWAYS<<"...done."<(_threadObjects.size());++i) { int status; //thread->setStackSize(1024*256); status = _threadObjects[i]->start(); assert(status == 0); } // Do something in the main thread for(int i=0;i<10000000;i++) OSG_ALWAYS<<""; // Signal threads to finish for(int i=0;i(_threadObjects.size());++i) { //_threadObjects[i]->setDone(true); // non blocking _threadObjects[i]->cancel(); // Blocking } /*for(int i=0;i<100000000;i++) OSG_ALWAYS<<"";*/ }