--- innwebd/controld.cpp 2004/07/03 13:56:04 1.4 +++ innwebd/controld.cpp 2004/07/03 15:10:23 1.5 @@ -379,22 +379,6 @@ int controld::load_conf(const char* conf this->innd.configure(innd_id,innd_name,innd_server,innd_uid,innd_address,innd_port,conn_str); this->outd.configure(innd_id,innd_name,innd_server,innd_uid,innd_address,0,conn_str); - base* p_ParentThread; - - p_ParentThread = new base_active(); - - this->SetParentThread(p_ParentThread); - this->bbsd.SetParentThread(p_ParentThread); - this->innd.SetParentThread(p_ParentThread); - this->outd.SetParentThread(p_ParentThread); - - p_ParentThread->SetThreadPool(new thread_pool(TS_MAX_THREAD)); - - if (p_ParentThread->GetThreadPool()->GetLastError() != 0) - { - syslog << logfile::log_head << "Create Thread Pool ... failed" << endl; - } - return 0; } @@ -471,3 +455,31 @@ void controld::ShutdownChild(void) syslog << logfile::log_head << "End OUTD ... Failed" << endl; } } + +int controld::InitThreadPool(void) +{ + base* p_ParentThread; + + p_ParentThread = new controld(); + + this->SetParentThread(p_ParentThread); + this->bbsd.SetParentThread(p_ParentThread); + this->innd.SetParentThread(p_ParentThread); + this->outd.SetParentThread(p_ParentThread); + + p_ParentThread->SetThreadPool(new thread_pool(TS_MAX_THREAD)); + + if (p_ParentThread->GetThreadPool()->GetLastError() != 0) + { + syslog << logfile::log_head << "Create Thread Pool ... failed" << endl; + } + + return 0; +} + +int controld::CleanupThreadPool(void) +{ + delete(this->GetParentThread()); + + return 0; +}