| 130 | #endif |
| 131 | |
| 132 | static av_cold void executor_free(FFExecutor *e, const int has_lock, const int has_cond) |
| 133 | { |
| 134 | if (e->thread_count) { |
| 135 | //signal die |
| 136 | ff_mutex_lock(&e->lock); |
| 137 | e->die = 1; |
| 138 | ff_cond_broadcast(&e->cond); |
| 139 | ff_mutex_unlock(&e->lock); |
| 140 | |
| 141 | for (int i = 0; i < e->thread_count; i++) |
| 142 | executor_thread_join(e->threads[i].thread, NULL); |
| 143 | } |
| 144 | if (has_cond) |
| 145 | ff_cond_destroy(&e->cond); |
| 146 | if (has_lock) |
| 147 | ff_mutex_destroy(&e->lock); |
| 148 | |
| 149 | av_free(e->threads); |
| 150 | av_free(e->q); |
| 151 | av_free(e->local_contexts); |
| 152 | |
| 153 | av_free(e); |
| 154 | } |
| 155 | |
| 156 | av_cold FFExecutor* ff_executor_alloc(const FFTaskCallbacks *cb, int thread_count) |
| 157 | { |
no test coverage detected