| 273 | } |
| 274 | |
| 275 | WELS_THREAD_ERROR_CODE CWelsThreadPool::CreateIdleThread() { |
| 276 | CWelsTaskThread* pThread = new CWelsTaskThread (this); |
| 277 | |
| 278 | if (NULL == pThread) { |
| 279 | return WELS_THREAD_ERROR_GENERAL; |
| 280 | } |
| 281 | |
| 282 | if (WELS_THREAD_ERROR_OK != pThread->Start()) { |
| 283 | return WELS_THREAD_ERROR_GENERAL; |
| 284 | } |
| 285 | //fprintf(stdout, "ThreadPool: AddThreadToIdleQueue: %x\n", pThread); |
| 286 | AddThreadToIdleQueue (pThread); |
| 287 | |
| 288 | return WELS_THREAD_ERROR_OK; |
| 289 | } |
| 290 | |
| 291 | void CWelsThreadPool::DestroyThread (CWelsTaskThread* pThread) { |
| 292 | pThread->Kill(); |