///Launches a thread for the manager and starts accepting Tasks. void ODManager::Init() { mCurrentThreads = 0; mMaxThreads = 5; // wxLogDebug(wxT("Initializing ODManager...Creating manager thread\n")); ODManagerHelperThread* startThread = new ODManagerHelperThread; // startThread->SetPriority(0);//default of 50. startThread->Create(); printf("starting thread from init\n"); startThread->Run(); printf("started thread from init\n"); //destruction is taken care of by wx thread code. TODO:Check if pthreads code does this. }
///Launches a thread for the manager and starts accepting Tasks. void ODManager::Init() { mCurrentThreads = 0; mMaxThreads = 5; // wxLogDebug(wxT("Initializing ODManager...Creating manager thread")); // This is a detached thread, so it deletes itself when it finishes // ... except on Mac where we we don't use wxThread for reasons unexplained ODManagerHelperThread* startThread = safenew ODManagerHelperThread; // startThread->SetPriority(0);//default of 50. startThread->Create(); // printf("starting thread from init\n"); startThread->Run(); // printf("started thread from init\n"); //destruction of thread is taken care of by thread library }