--- innwebd/outd.cpp 2004/07/04 22:49:03 1.5 +++ innwebd/outd.cpp 2004/07/12 20:36:08 1.6 @@ -69,13 +69,21 @@ int outd::work() //Terminate if timeout(5 minutes) or stopped if ((t_count >= 3000 || this->thread_terminate) && base_active::uThreadCount > 0) { - if (TerminateThread(hThreadCurrent,-1)) + if ((hThreadCurrent = OpenThread(THREAD_TERMINATE,FALSE,ulThreadId)) == NULL) { - syslog << logfile::log_head << "Terminate send thread ... OK" << endl; + syslog << logfile::log_head << "Get thread handle error in outd::work()" << endl; } else { - syslog << logfile::log_head << "Terminate send thread ... Failed" << endl; + if (TerminateThread(hThreadCurrent,-1)) + { + syslog << logfile::log_head << "Terminate send thread ... OK" << endl; + } + else + { + syslog << logfile::log_head << "Terminate send thread ... Failed" << endl; + } + CloseHandle(hThreadCurrent); } base_active::uThreadCount--; }