Mercurial > libavcodec.hg
comparison pthread.c @ 2035:e1b69326ae36 libavcodec
10l fixes by ("Debabrata Banerjee" <davatar at comcast dot net>)
| author | michael |
|---|---|
| date | Wed, 26 May 2004 20:04:49 +0000 |
| parents | 50e92cec1b84 |
| children | ef2149182f1c |
comparison
equal
deleted
inserted
replaced
| 2034:9629c1180d5f | 2035:e1b69326ae36 |
|---|---|
| 85 ThreadContext *c = avctx->thread_opaque; | 85 ThreadContext *c = avctx->thread_opaque; |
| 86 int i; | 86 int i; |
| 87 | 87 |
| 88 pthread_mutex_lock(&c->current_job_lock); | 88 pthread_mutex_lock(&c->current_job_lock); |
| 89 c->done = 1; | 89 c->done = 1; |
| 90 pthread_cond_signal(&c->current_job_cond); | 90 pthread_cond_broadcast(&c->current_job_cond); |
| 91 pthread_mutex_unlock(&c->current_job_lock); | 91 pthread_mutex_unlock(&c->current_job_lock); |
| 92 | 92 |
| 93 for (i=0; i<avctx->thread_count; i++) | 93 for (i=0; i<avctx->thread_count; i++) |
| 94 pthread_join(c->workers[i], NULL); | 94 pthread_join(c->workers[i], NULL); |
| 95 | 95 |
| 96 pthread_mutex_destroy(&c->current_job_lock); | 96 pthread_mutex_destroy(&c->current_job_lock); |
| 97 pthread_cond_destroy(&c->current_job_cond); | 97 pthread_cond_destroy(&c->current_job_cond); |
| 98 pthread_cond_destroy(&c->last_job_cond); | 98 pthread_cond_destroy(&c->last_job_cond); |
| 99 av_free(c->workers); | 99 av_free(c->workers); |
| 100 av_freep(c); | 100 av_free(c); |
| 101 } | 101 } |
| 102 | 102 |
| 103 int avcodec_thread_execute(AVCodecContext *avctx, action_t* func, void **arg, int *ret, int job_count) | 103 int avcodec_thread_execute(AVCodecContext *avctx, action_t* func, void **arg, int *ret, int job_count) |
| 104 { | 104 { |
| 105 ThreadContext *c= avctx->thread_opaque; | 105 ThreadContext *c= avctx->thread_opaque; |
