| 193 | } |
| 194 | |
| 195 | void 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 | } |
nothing calls this directly
no test coverage detected