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