MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / av_executor_execute

Function av_executor_execute

libavutil/executor.c:195–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193}
194
195void av_executor_execute(AVExecutor *e, AVTask *t)
196{
197 AVTaskCallbacks *cb = &e->cb;
198 AVTask **prev;
199
200 if (e->thread_count)
201 ff_mutex_lock(&e->lock);
202 if (t) {
203 for (prev = &e->tasks; *prev && cb->priority_higher(*prev, t); prev = &(*prev)->next)
204 /* nothing */;
205 add_task(prev, t);
206 }
207 if (e->thread_count) {
208 ff_cond_signal(&e->cond);
209 ff_mutex_unlock(&e->lock);
210 }
211
212 if (!e->thread_count || !HAVE_THREADS) {
213 if (e->recursive)
214 return;
215 e->recursive = true;
216 // We are running in a single-threaded environment, so we must handle all tasks ourselves
217 while (run_one_task(e, e->local_contexts))
218 /* nothing */;
219 e->recursive = false;
220 }
221}

Callers

nothing calls this directly

Calls 5

ff_mutex_lockFunction · 0.85
ff_cond_signalFunction · 0.85
ff_mutex_unlockFunction · 0.85
add_taskFunction · 0.70
run_one_taskFunction · 0.70

Tested by

no test coverage detected