arc: Add "maintenance print arc" command prefix
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.threads / staticthreads.c
index 80535d230a3f3a7ec3c7954a6dbcb54951175739..31c7324eed40d010ae985a353255412c3df578c9 100644 (file)
@@ -1,6 +1,6 @@
 /* This test program is part of GDB, The GNU debugger.
 
-   Copyright 2004, 2007-2012 Free Software Foundation, Inc.
+   Copyright 2004-2017 Free Software Foundation, Inc.
 
    Originally written by Jeff Johnston <jjohnstn@redhat.com>,
    contributed by Red Hat
 
 sem_t semaphore;
 
+#ifdef HAVE_TLS
+__thread int tlsvar;
+#endif
+
 void *
 thread_function (void *arg)
 {
-  printf ("Thread executing\n");
+#ifdef HAVE_TLS
+  tlsvar = 2;
+#endif
   while (sem_wait (&semaphore) != 0)
     {
       if (errno != EINTR)
        {
          perror ("thread_function");
-         return;
+         return NULL;
        }
     }
+  printf ("Thread executing\n"); /* tlsvar-is-set */
   return NULL;
 }
 
@@ -57,6 +64,9 @@ main (int argc, char **argv)
       return -1;
     }
 
+#ifdef HAVE_TLS
+  tlsvar = 1;
+#endif
 
   /* Create a thread, wait for it to complete.  */
   {
This page took 0.025161 seconds and 4 git commands to generate.