| 69 |
//Terminate if timeout(5 minutes) or stopped |
//Terminate if timeout(5 minutes) or stopped |
| 70 |
if ((t_count >= 3000 || this->thread_terminate) && base_active::uThreadCount > 0) |
if ((t_count >= 3000 || this->thread_terminate) && base_active::uThreadCount > 0) |
| 71 |
{ |
{ |
| 72 |
if (TerminateThread(hThreadCurrent,-1)) |
if ((hThreadCurrent = OpenThread(THREAD_TERMINATE,FALSE,ulThreadId)) == NULL) |
| 73 |
{ |
{ |
| 74 |
syslog << logfile::log_head << "Terminate send thread ... OK" << endl; |
syslog << logfile::log_head << "Get thread handle error in outd::work()" << endl; |
| 75 |
} |
} |
| 76 |
else |
else |
| 77 |
{ |
{ |
| 78 |
syslog << logfile::log_head << "Terminate send thread ... Failed" << endl; |
if (TerminateThread(hThreadCurrent,-1)) |
| 79 |
|
{ |
| 80 |
|
syslog << logfile::log_head << "Terminate send thread ... OK" << endl; |
| 81 |
|
} |
| 82 |
|
else |
| 83 |
|
{ |
| 84 |
|
syslog << logfile::log_head << "Terminate send thread ... Failed" << endl; |
| 85 |
|
} |
| 86 |
|
CloseHandle(hThreadCurrent); |
| 87 |
} |
} |
| 88 |
base_active::uThreadCount--; |
base_active::uThreadCount--; |
| 89 |
} |
} |