[PATCH] D18476: [tsan] Remove long sleeps from fork tests

Kuba Brecka via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 28 03:34:55 PDT 2016


kubabrecka updated this revision to Diff 51775.
kubabrecka added a comment.

Updating patch.


http://reviews.llvm.org/D18476

Files:
  test/tsan/fork_deadlock.cc
  test/tsan/fork_multithreaded.cc

Index: test/tsan/fork_multithreaded.cc
===================================================================
--- test/tsan/fork_multithreaded.cc
+++ test/tsan/fork_multithreaded.cc
@@ -6,7 +6,7 @@
 #include <sys/wait.h>
 
 static void *sleeper(void *p) {
-  sleep(10);  // not intended to exit during test
+  sleep(1000);  // not intended to exit during test
   return 0;
 }
 
Index: test/tsan/fork_deadlock.cc
===================================================================
--- test/tsan/fork_deadlock.cc
+++ test/tsan/fork_deadlock.cc
@@ -12,18 +12,10 @@
   return 0;
 }
 
-static void *watchdog(void *p) {
-  sleep(100);  // is not intended to exit
-  fprintf(stderr, "timed out after 100 seconds\n");
-  exit(1);
-  return 0;
-}
-
 int main() {
   barrier_init(&barrier, 2);
-  pthread_t th1, th2;
+  pthread_t th1;
   pthread_create(&th1, 0, incrementer, 0);
-  pthread_create(&th2, 0, watchdog, 0);
   for (int i = 0; i < 10; i++) {
     switch (fork()) {
     default:  // parent


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18476.51775.patch
Type: text/x-patch
Size: 989 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160328/8853e47b/attachment.bin>


More information about the llvm-commits mailing list