summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2012-07-19 19:08:31 +0200
committerClément Bœsch <ubitux@gmail.com>2012-07-19 19:08:36 +0200
commit55ed91c8565a3c562d2982e1cd5e66df06c6c190 (patch)
treef25c2eae3adc3fb7fa8de174644c30b260f267f7
parent652887d6fd373a88bc4f7540679ae572b9ad2da9 (diff)
threads: fix a potential race spotted by helgrind.
-rw-r--r--libavcodec/pthread.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index 7f2ea09a74..597aeba91f 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -975,9 +975,9 @@ int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f)
avctx->get_buffer == avcodec_default_get_buffer) {
err = avctx->get_buffer(avctx, f);
} else {
+ pthread_mutex_lock(&p->progress_mutex);
p->requested_frame = f;
p->state = STATE_GET_BUFFER;
- pthread_mutex_lock(&p->progress_mutex);
pthread_cond_broadcast(&p->progress_cond);
while (p->state != STATE_SETTING_UP)