]> granicus.if.org Git - libatomic_ops/commitdiff
Workaround test_stack failure on AIX/ppc
authorFabrizio Fabbri <ffabbri4@bloomberg.net>
Fri, 7 Apr 2017 13:56:04 +0000 (09:56 -0400)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 10 May 2017 05:46:50 +0000 (08:46 +0300)
* 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.

src/atomic_ops_stack.c

index adfbcff42ec3c705275542e068e251d8dd20b90a..e199bffb4dbefa4d2b0469806c7f1565fda2ade2 100644 (file)
@@ -152,11 +152,14 @@ AO_stack_pop_explicit_aux_acquire(volatile AO_t *list, AO_stack_aux * a)
   /* list.  Otherwise it's possible that a reinsertion of it was        */
   /* already started before we added the black list entry.              */
 # if defined(__alpha__) && (__GNUC__ == 4)
-    if (first != AO_load(list))
+    if (first != AO_load_acquire(list))
                         /* Workaround __builtin_expect bug found in     */
                         /* gcc-4.6.3/alpha causing test_stack failure.  */
 # else
-    if (AO_EXPECT_FALSE(first != AO_load(list)))
+    if (AO_EXPECT_FALSE(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.    */
 # endif
   {
     AO_store_release(a->AO_stack_bl+i, 0);