about summary refs log tree commit diff
path: root/nptl/tst-exit3.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2016-08-26 19:27:16 +0200
committerFlorian Weimer <fweimer@redhat.com>2016-08-26 19:40:17 +0200
commit7e625f7e85b4e88f10dbde35a0641742af581806 (patch)
tree9548c7d75393d1b9cd033ea0c875936bee6f9a52 /nptl/tst-exit3.c
parent0ac8ee53e8efbfd6e1c37094b4653f5c2dad65b5 (diff)
downloadglibc-7e625f7e85b4e88f10dbde35a0641742af581806.tar.gz
glibc-7e625f7e85b4e88f10dbde35a0641742af581806.tar.xz
glibc-7e625f7e85b4e88f10dbde35a0641742af581806.zip
nptl: Avoid expected SIGALRM in most tests [BZ #20432]
Before this change, several tests did not detect early deadlocks
because they used SIGALRM as the expected signal, and they ran
for the full default TIMEOUT seconds.

This commit adds a new delayed_exit function to the test skeleton,
along with several error-checking wrappers to pthread functions.
Additional error checking is introduced into several tests.
Diffstat (limited to 'nptl/tst-exit3.c')
-rw-r--r--nptl/tst-exit3.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/nptl/tst-exit3.c b/nptl/tst-exit3.c
index da92c82c0e..9481ed9b42 100644
--- a/nptl/tst-exit3.c
+++ b/nptl/tst-exit3.c
@@ -5,6 +5,10 @@
 #include <string.h>
 #include <unistd.h>
 
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
 
 static pthread_barrier_t b;
 
@@ -69,13 +73,11 @@ do_test (void)
       exit (1);
     }
 
+  delayed_exit (3);
+
   /* Terminate only this thread.  */
   pthread_exit (NULL);
 
   /* NOTREACHED */
   return 1;
 }
-
-#define EXPECTED_SIGNAL SIGALRM
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"