From: Fabrizio Fabbri Date: Fri, 7 Apr 2017 13:56:04 +0000 (-0400) Subject: Workaround test_stack failure on AIX/ppc X-Git-Tag: v7.2h~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=40fc61a40b8d193b21502fded1eff7d59f19bdfd;p=libatomic_ops Workaround test_stack failure on AIX/ppc (Cherry-pick commit 9b697e8 from 'release-7_4' branch.) * src/atomic_ops_stack.c [AO_USE_ALMOST_LOCK_FREE] (AO_stack_pop_explicit_aux_acquire): Replace AO_load to AO_load_acquire when loaded value is compared to first; add comment. --- diff --git a/src/atomic_ops_stack.c b/src/atomic_ops_stack.c index cf7a02e..8da49dd 100644 --- a/src/atomic_ops_stack.c +++ b/src/atomic_ops_stack.c @@ -193,7 +193,11 @@ AO_stack_pop_explicit_aux_acquire(volatile AO_t *list, AO_stack_aux * a) /* We need to make sure that first is still the first entry on the */ /* list. Otherwise it's possible that a reinsertion of it was */ /* already started before we added the black list entry. */ - if (first != AO_load(list)) { + if (first != AO_load_acquire(list)) + /* Workaround test failure on AIX, at least, by */ + /* using acquire ordering semantics for this */ + /* load. Probably, it is not the right fix. */ + { AO_store_release(a->AO_stack_bl+i, 0); goto retry; }