vlc | branch: master | Rémi Denis-Courmont <[email protected]> | Sun Jul 1 12:20:34 2018 +0300| [ae2fed77b4833d522087176048d2586c60f9bd9b] | committer: Rémi Denis-Courmont
picture_pool: relax memory order > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ae2fed77b4833d522087176048d2586c60f9bd9b --- src/misc/picture_pool.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/misc/picture_pool.c b/src/misc/picture_pool.c index 74712c81f5..874a04e4d8 100644 --- a/src/misc/picture_pool.c +++ b/src/misc/picture_pool.c @@ -53,9 +53,10 @@ struct picture_pool_t { static void picture_pool_Destroy(picture_pool_t *pool) { - if (atomic_fetch_sub(&pool->refs, 1) != 1) + if (atomic_fetch_sub_explicit(&pool->refs, 1, memory_order_release) != 1) return; + atomic_thread_fence(memory_order_acquire); vlc_cond_destroy(&pool->wait); vlc_mutex_destroy(&pool->lock); aligned_free(pool); @@ -231,7 +232,7 @@ picture_t *picture_pool_Get(picture_pool_t *pool) picture_t *clone = picture_pool_ClonePicture(pool, i); if (clone != NULL) { assert(clone->p_next == NULL); - atomic_fetch_add(&pool->refs, 1); + atomic_fetch_add_explicit(&pool->refs, 1, memory_order_relaxed); } return clone; } @@ -272,7 +273,7 @@ picture_t *picture_pool_Wait(picture_pool_t *pool) picture_t *clone = picture_pool_ClonePicture(pool, i); if (clone != NULL) { assert(clone->p_next == NULL); - atomic_fetch_add(&pool->refs, 1); + atomic_fetch_add_explicit(&pool->refs, 1, memory_order_relaxed); } return clone; } _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
