| 414 | } |
| 415 | |
| 416 | void ThreadPool::DestroyPool() |
| 417 | { |
| 418 | MicroThread* thread = NULL; |
| 419 | while (!_freelist.empty()) |
| 420 | { |
| 421 | thread = _freelist.front(); |
| 422 | _freelist.pop(); |
| 423 | thread->Destroy(); |
| 424 | delete thread; |
| 425 | } |
| 426 | |
| 427 | _total_num = 0; |
| 428 | _use_num = 0; |
| 429 | } |
| 430 | |
| 431 | MicroThread* ThreadPool::AllocThread() |
| 432 | { |