#include "SimHost.h" #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(numberofChannels, _frameBarrier); 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); } // Enter the SimHost main loop while(!done) { // Wait until all Channels have sent an SOF packet _frameBarrier.block(numberofChannels+1); // Sync the main and all IG threads. OSG_ALWAYS<<"All IGConnectors have recieved a SOF packet: Starting new Frame"<(_threadObjects.size());++i) { //_threadObjects[i]->setDone(true); // non blocking _threadObjects[i]->cancel(); // Blocking } }