12745e
diff -pruN glibc-2.17-c758a686/nptl/tst-join7mod.c glibc-2.17-c758a686.new/nptl/tst-join7mod.c
12745e
--- glibc-2.17-c758a686/nptl/tst-join7mod.c	2015-08-13 17:06:56.505685552 +0530
12745e
+++ glibc-2.17-c758a686.new/nptl/tst-join7mod.c	2015-08-14 12:42:10.446315345 +0530
12745e
@@ -18,6 +18,7 @@
12745e
    <http://www.gnu.org/licenses/>.  */
12745e
 
12745e
 #include <stdio.h>
12745e
+#include <string.h>
12745e
 #include <pthread.h>
12745e
 #include <atomic.h>
12745e
 
12745e
@@ -27,7 +28,14 @@ static int running = 1;
12745e
 static void *
12745e
 test_run (void *p)
12745e
 {
12745e
-  while (atomic_load_relaxed (&running))
12745e
+  /* Spin on the value of RUNNING till it is 1.  The RHEL-7 version of atomic.h
12745e
+     does not yet have an atomic_load.  We don't need an acquire/release
12745e
+     barrier either since there is no ordering to worry about, but again,
12745e
+     atomic.h does not have relaxed atomic operations.  */
12745e
+  int oldval;
12745e
+  do
12745e
+    oldval = atomic_compare_and_exchange_val_acq (&running, 0, 0);
12745e
+  while (oldval == 1);
12745e
     printf ("Test running\n");
12745e
   printf ("Test finished\n");
12745e
   return NULL;
12745e
@@ -48,7 +56,7 @@ do_init (void)
12745e
 static void __attribute__ ((destructor))
12745e
 do_end (void)
12745e
 {
12745e
-  atomic_store_relaxed (&running, 0);
12745e
+  atomic_exchange_rel (&running, 0);
12745e
   int ret = pthread_join (th, NULL);
12745e
 
12745e
   if (ret != 0)