MCPcopy Create free account
hub / github.com/cisco/openh264 / ExecuteTask

Method ExecuteTask

codec/common/src/WelsThreadPool.cpp:229–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227}
228
229void CWelsThreadPool::ExecuteTask() {
230 //fprintf(stdout, "ThreadPool: scheduled tasks: ExecuteTask\n");
231 CWelsTaskThread* pThread = NULL;
232 IWelsTask* pTask = NULL;
233 while (GetWaitedTaskNum() > 0) {
234 //fprintf(stdout, "ThreadPool: ExecuteTask: waiting task %d\n", GetWaitedTaskNum());
235 pThread = GetIdleThread();
236 if (pThread == NULL) {
237 //fprintf(stdout, "ThreadPool: ExecuteTask: no IdleThread\n");
238
239 break;
240 }
241 pTask = GetWaitedTask();
242 //fprintf(stdout, "ThreadPool: ExecuteTask = %x at thread %x\n", pTask, pThread);
243 if (pTask) {
244 pThread->SetTask (pTask);
245 } else {
246 AddThreadToIdleQueue (pThread);
247 }
248 }
249}
250
251WELS_THREAD_ERROR_CODE CWelsThreadPool::QueueTask (IWelsTask* pTask) {
252 CWelsAutoLock cLock (m_cLockPool);

Callers

nothing calls this directly

Calls 1

SetTaskMethod · 0.80

Tested by

no test coverage detected