| 1 |
/*******************************************************/ |
/*******************************************************/ |
| 2 |
/* */ |
/* */ |
| 3 |
/* LeafOK Innbbsd */ |
/* LeafOK Innbbsd */ |
|
/* Copyright (C) LeafOK.com, 2003-2005 */ |
|
| 4 |
/* */ |
/* */ |
| 5 |
/* Programmed by Leaf */ |
/* Copyright (C) LeafOK.com, 2003-2008 */ |
|
/* E-mail:leaflet@leafok.com QQ:6049044 */ |
|
| 6 |
/* */ |
/* */ |
| 7 |
/* http://bbs.leafok.com */ |
/* http://www.leafok.com */ |
|
/* http://bbs.leafok.net */ |
|
|
/* http://bbs.fenglin.info */ |
|
| 8 |
/* */ |
/* */ |
| 9 |
/*******************************************************/ |
/*******************************************************/ |
| 10 |
|
|
| 225 |
// Remove dead thread from thread pool |
// Remove dead thread from thread pool |
| 226 |
if (p->RemoveThread(ulThreadId) != 0) |
if (p->RemoveThread(ulThreadId) != 0) |
| 227 |
{ |
{ |
| 228 |
syslog << logfile::log_head << "Unregister thread ... Failed" << endl; |
syslog << logfile::log_head << "Unregister thread (" << ulThreadId << ") ... Failed" << endl; |
| 229 |
} |
} |
| 230 |
// Kill dead thread |
// Kill dead thread |
| 231 |
if ((hThread = OpenThread(THREAD_TERMINATE,FALSE,ulThreadId)) == NULL) |
if ((hThread = OpenThread(THREAD_TERMINATE,FALSE,ulThreadId)) == NULL) |
| 236 |
{ |
{ |
| 237 |
if (TerminateThread(hThread,-1)) |
if (TerminateThread(hThread,-1)) |
| 238 |
{ |
{ |
| 239 |
syslog << logfile::log_head << "Terminate dead thread ... OK" << endl; |
syslog << logfile::log_head << "Terminate dead thread (" << ulThreadId << ") ... OK" << endl; |
| 240 |
} |
} |
| 241 |
else |
else |
| 242 |
{ |
{ |
| 243 |
syslog << logfile::log_head << "Terminate dead thread ... Failed" << endl; |
syslog << logfile::log_head << "Terminate dead thread (" << ulThreadId << ") ... Failed" << endl; |
| 244 |
} |
} |
| 245 |
CloseHandle(hThread); |
CloseHandle(hThread); |
| 246 |
} |
} |
| 359 |
{ |
{ |
| 360 |
if (TerminateThread(hThread,-1)) |
if (TerminateThread(hThread,-1)) |
| 361 |
{ |
{ |
| 362 |
syslog << logfile::log_head << "Terminate all thread ... OK" << endl; |
syslog << logfile::log_head << "Terminate all thread (" << ulThreadId << ") ... OK" << endl; |
| 363 |
} |
} |
| 364 |
else |
else |
| 365 |
{ |
{ |
| 366 |
syslog << logfile::log_head << "Terminate all thread ... Failed" << endl; |
syslog << logfile::log_head << "Terminate all thread (" << ulThreadId << ") ... Failed" << endl; |
| 367 |
} |
} |
| 368 |
CloseHandle(hThread); |
CloseHandle(hThread); |
| 369 |
} |
} |