--- innwebd/outd.cpp 2004/07/04 22:49:03 1.5 +++ innwebd/outd.cpp 2005/02/26 16:10:26 1.8 @@ -1,7 +1,7 @@ /*******************************************************/ /* */ /* LeafOK Innbbsd */ -/* Copyright (C) LeafOK.com, 2003-2004 */ +/* Copyright (C) LeafOK.com, 2003-2005 */ /* */ /* Programmed by Leaf */ /* E-mail:leaflet@leafok.com QQ:6049044 */ @@ -54,7 +54,7 @@ int outd::work() { base_active::uThreadCount++; CloseHandle(hThreadCurrent); - syslog << logfile::log_head << "Create send thread ... OK" << endl; +// syslog << logfile::log_head << "Create send thread ... OK" << endl; } else { @@ -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--; }