[PATCH] D18496: [tsan] Fix a crash when exiting the main thread (e.g. dispatch_main)

Kuba Brecka via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 27 07:23:56 PDT 2016


kubabrecka added inline comments.

================
Comment at: test/tsan/Darwin/dispatch_main.mm:27
@@ +26,3 @@
+      NSLog(@"Done.");
+      sleep(3);
+      exit(0);
----------------
dvyukov wrote:
> Why do we need this sleep? Can we remove it? Can we use the invisible barrier instead?
> This test will run for 3 seconds. I would like to reduce it's duration.
I'll try to remove it.

================
Comment at: test/tsan/Darwin/dispatch_main.mm:28
@@ +27,3 @@
+      sleep(3);
+      exit(0);
+    });
----------------
dvyukov wrote:
> This is exit which should terminate whole process. How is calling pthread_exit? Where? 
pthread_exit is called immediately from dispatch_main below, not here.


http://reviews.llvm.org/D18496





More information about the llvm-commits mailing list