| 323 | } |
| 324 | |
| 325 | CWelsTaskThread* CWelsThreadPool::GetIdleThread() { |
| 326 | CWelsAutoLock cLock (m_cLockIdleTasks); |
| 327 | |
| 328 | if (NULL == m_cIdleThreads || m_cIdleThreads->size() == 0) { |
| 329 | return NULL; |
| 330 | } |
| 331 | |
| 332 | //fprintf(stdout, "CWelsThreadPool::GetIdleThread=%d\n", m_cIdleThreads->size()); |
| 333 | |
| 334 | CWelsTaskThread* pThread = m_cIdleThreads->begin(); |
| 335 | m_cIdleThreads->pop_front(); |
| 336 | return pThread; |
| 337 | } |
| 338 | |
| 339 | int32_t CWelsThreadPool::GetBusyThreadNum() { |
| 340 | return (m_cBusyThreads?m_cBusyThreads->size():0); |