| 85 | } |
| 86 | |
| 87 | void avcodec_thread_free(AVCodecContext *avctx) |
| 88 | { |
| 89 | ThreadContext *c = avctx->thread_opaque; |
| 90 | int i; |
| 91 | |
| 92 | pthread_mutex_lock(&c->current_job_lock); |
| 93 | c->done = 1; |
| 94 | pthread_cond_broadcast(&c->current_job_cond); |
| 95 | pthread_mutex_unlock(&c->current_job_lock); |
| 96 | |
| 97 | for (i=0; i<avctx->thread_count; i++) |
| 98 | pthread_join(c->workers[i], NULL); |
| 99 | |
| 100 | pthread_mutex_destroy(&c->current_job_lock); |
| 101 | pthread_cond_destroy(&c->current_job_cond); |
| 102 | pthread_cond_destroy(&c->last_job_cond); |
| 103 | av_free(c->workers); |
| 104 | av_freep(&avctx->thread_opaque); |
| 105 | } |
| 106 | |
| 107 | static int avcodec_thread_execute(AVCodecContext *avctx, action_func* func, void *arg, int *ret, int job_count, int job_size) |
| 108 | { |
no test coverage detected