diff mbox

[FFmpeg-devel] vp9: fix explicit memory order for report_progress.

Message ID 1505243803-46371-1-git-send-email-rsbultje@gmail.com
State Accepted
Commit 1db03e952b4ee998f2a19c037f60d17dc90e8f6c
Headers show

Commit Message

Ronald S. Bultje Sept. 12, 2017, 7:16 p.m. UTC
---
 libavcodec/vp9.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Clément Bœsch Sept. 12, 2017, 7:18 p.m. UTC | #1
On Tue, Sep 12, 2017 at 03:16:43PM -0400, Ronald S. Bultje wrote:
> ---
>  libavcodec/vp9.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
> index 66ccb6c..6b5de19 100644
> --- a/libavcodec/vp9.c
> +++ b/libavcodec/vp9.c
> @@ -73,7 +73,7 @@ static int vp9_alloc_entries(AVCodecContext *avctx, int n) {
>  
>  static void vp9_report_tile_progress(VP9Context *s, int field, int n) {
>      pthread_mutex_lock(&s->progress_mutex);
> -    atomic_fetch_add_explicit(&s->entries[field], n, memory_order_relaxed);
> +    atomic_fetch_add_explicit(&s->entries[field], n, memory_order_release);
>      pthread_cond_signal(&s->progress_cond);
>      pthread_mutex_unlock(&s->progress_mutex);
>  }

tested, works, LGTM
Ronald S. Bultje Sept. 12, 2017, 7:26 p.m. UTC | #2
Hi,

On Tue, Sep 12, 2017 at 3:18 PM, Clément Bœsch <u@pkh.me> wrote:

> On Tue, Sep 12, 2017 at 03:16:43PM -0400, Ronald S. Bultje wrote:
> > ---
> >  libavcodec/vp9.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
> > index 66ccb6c..6b5de19 100644
> > --- a/libavcodec/vp9.c
> > +++ b/libavcodec/vp9.c
> > @@ -73,7 +73,7 @@ static int vp9_alloc_entries(AVCodecContext *avctx,
> int n) {
> >
> >  static void vp9_report_tile_progress(VP9Context *s, int field, int n) {
> >      pthread_mutex_lock(&s->progress_mutex);
> > -    atomic_fetch_add_explicit(&s->entries[field], n,
> memory_order_relaxed);
> > +    atomic_fetch_add_explicit(&s->entries[field], n,
> memory_order_release);
> >      pthread_cond_signal(&s->progress_cond);
> >      pthread_mutex_unlock(&s->progress_mutex);
> >  }
>
> tested, works, LGTM


TY, pushed.

Ronald
diff mbox

Patch

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 66ccb6c..6b5de19 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -73,7 +73,7 @@  static int vp9_alloc_entries(AVCodecContext *avctx, int n) {
 
 static void vp9_report_tile_progress(VP9Context *s, int field, int n) {
     pthread_mutex_lock(&s->progress_mutex);
-    atomic_fetch_add_explicit(&s->entries[field], n, memory_order_relaxed);
+    atomic_fetch_add_explicit(&s->entries[field], n, memory_order_release);
     pthread_cond_signal(&s->progress_cond);
     pthread_mutex_unlock(&s->progress_mutex);
 }