threads: fix a potential race spotted by helgrind.

This commit is contained in:
Clément Bœsch 2012-07-19 19:08:31 +02:00
parent 652887d6fd
commit 55ed91c856
1 changed files with 1 additions and 1 deletions

View File

@ -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)