Waits for all threads to finish.
| 717 | |
| 718 | /// Waits for all threads to finish. |
| 719 | static 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) |
| 740 | DEFINE_OFFSET_ARRAY(FrameThreadContext, thread_ctx, pthread_init_cnt, |
no test coverage detected