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

Function executor_free

libavcodec/executor.c:132–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130#endif
131
132static 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
156av_cold FFExecutor* ff_executor_alloc(const FFTaskCallbacks *cb, int thread_count)
157{

Callers 2

ff_executor_allocFunction · 0.70
ff_executor_freeFunction · 0.70

Calls 6

ff_mutex_lockFunction · 0.85
ff_cond_broadcastFunction · 0.85
ff_mutex_unlockFunction · 0.85
ff_cond_destroyFunction · 0.85
ff_mutex_destroyFunction · 0.85
av_freeFunction · 0.50

Tested by

no test coverage detected