
I am trying to setup my application so that it runs as a daemon. One aspect that I need to run a sanity check on is to determine if there are currently any parent threads running. Currently this is what I am testing with, when all threads are finish running, I then join all the threads to terminate them. Doing so should give me a thread group size of 0. However, this is now the case. Currently after I join the threads, the thread group size is still 0. Here is my current test code that I am working with. Any help with this is greatly appreciated. int main(int argc, char *argv[]) { InitConfig mconfig; if(mconfig.setConfig()){ boost::thread_group Tg; cout << "Thread Size Before: " << Tg.size() << endl; // DISPLAYS 0 for(int i = 1; i < 25; i++){ dmParse parse; Tg.create_thread(boost::bind(&dmParse::onInit,parse,i)); } cout << "Thread Size: " << Tg.size() << endl; // DISPLAYS 24 Tg.join_all(); cout << "Thread Count After:" << Tg.size() << endl; // DISPLAYS 24 }