--- innwebd/thread_pool.cpp 2004/07/04 06:45:23 1.5 +++ innwebd/thread_pool.cpp 2005/05/20 14:34:12 1.9 @@ -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 */ @@ -153,9 +153,9 @@ int thread_pool::RemoveThread(ULONG ulTh } -int thread_pool::SetThreadStatus(ULONG ulThreadd, int uStatus) +int thread_pool::SetThreadStatus(ULONG ulThreadId, int uStatus) { - UINTT i; + UINT i; if (this->uThreadCount <= 0) { @@ -229,7 +229,7 @@ DWORD thread_pool::KillDeadThread(LPVOID // Remove dead thread from thread pool if (p->RemoveThread(ulThreadId) != 0) { - syslog << logfile::log_head << "Unregister thread ... Failed" << endl; + syslog << logfile::log_head << "Unregister thread (" << ulThreadId << ") ... Failed" << endl; } // Kill dead thread if ((hThread = OpenThread(THREAD_TERMINATE,FALSE,ulThreadId)) == NULL) @@ -240,11 +240,11 @@ DWORD thread_pool::KillDeadThread(LPVOID { if (TerminateThread(hThread,-1)) { - syslog << logfile::log_head << "Terminate dead thread ... OK" << endl; + syslog << logfile::log_head << "Terminate dead thread (" << ulThreadId << ") ... OK" << endl; } else { - syslog << logfile::log_head << "Terminate dead thread ... Failed" << endl; + syslog << logfile::log_head << "Terminate dead thread (" << ulThreadId << ") ... Failed" << endl; } CloseHandle(hThread); } @@ -275,6 +275,7 @@ int thread_pool::EnableKillDeadThread(vo this->bTerminateThreadKiller = false; if (hThreadCurrent = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)thread_pool::KillDeadThread,(LPVOID)this,0,&ulThreadId)) { + CloseHandle(hThreadCurrent); syslog << logfile::log_head << "Create killer thread ... OK" << endl; } else @@ -362,11 +363,11 @@ int thread_pool::KillAllThread(void) { if (TerminateThread(hThread,-1)) { - syslog << logfile::log_head << "Terminate all thread ... OK" << endl; + syslog << logfile::log_head << "Terminate all thread (" << ulThreadId << ") ... OK" << endl; } else { - syslog << logfile::log_head << "Terminate all thread ... Failed" << endl; + syslog << logfile::log_head << "Terminate all thread (" << ulThreadId << ") ... Failed" << endl; } CloseHandle(hThread); }