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

Function park_frame_worker_threads

libavcodec/pthread_frame.c:719–737  ·  view source on GitHub ↗

Waits for all threads to finish.

Source from the content-addressed store, hash-verified

717
718/// Waits for all threads to finish.
719static av_cold void park_frame_worker_threads(FrameThreadContext *fctx, int thread_count)
720{
721 int i;
722
723 async_unlock(fctx);
724
725 for (i = 0; i < thread_count; i++) {
726 PerThreadContext *p = &fctx->threads[i];
727
728 if (atomic_load(&p->state) != STATE_INPUT_READY) {
729 pthread_mutex_lock(&p->progress_mutex);
730 while (atomic_load(&p->state) != STATE_INPUT_READY)
731 pthread_cond_wait(&p->output_cond, &p->progress_mutex);
732 pthread_mutex_unlock(&p->progress_mutex);
733 }
734 }
735
736 async_lock(fctx);
737}
738
739#define OFF(member) offsetof(FrameThreadContext, member)
740DEFINE_OFFSET_ARRAY(FrameThreadContext, thread_ctx, pthread_init_cnt,

Callers 2

ff_frame_thread_freeFunction · 0.85
ff_thread_flushFunction · 0.85

Calls 5

async_unlockFunction · 0.85
async_lockFunction · 0.85
pthread_mutex_lockFunction · 0.50
pthread_cond_waitFunction · 0.50
pthread_mutex_unlockFunction · 0.50

Tested by

no test coverage detected