diff options
author | Kuba Brecka <kuba.brecka@gmail.com> | 2016-09-14 13:53:06 +0000 |
---|---|---|
committer | Kuba Brecka <kuba.brecka@gmail.com> | 2016-09-14 13:53:06 +0000 |
commit | 37f25d7ae077a12ca1880d44ae0517d5ab4534ca (patch) | |
tree | ae4780279da9b2985d5352dd30a235497d59cbbe /test/tsan/Darwin/gcd-apply.mm | |
parent | 9504db07d2d5a5dc55f3e398b97379785e46c4d7 (diff) |
[tsan] Fix hanging gcd-apply and gcd-apply-race tests on macOS Sierra
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281462 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/tsan/Darwin/gcd-apply.mm')
-rw-r--r-- | test/tsan/Darwin/gcd-apply.mm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/tsan/Darwin/gcd-apply.mm b/test/tsan/Darwin/gcd-apply.mm index e68a4b182..a7dc3740d 100644 --- a/test/tsan/Darwin/gcd-apply.mm +++ b/test/tsan/Darwin/gcd-apply.mm @@ -17,6 +17,10 @@ void callback(void *context, size_t i) { int main(int argc, const char *argv[]) { barrier_init(&barrier, 2); fprintf(stderr, "start\n"); + + // Warm up GCD (workaround for macOS Sierra where dispatch_apply might run single-threaded). + dispatch_sync(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ }); + dispatch_queue_t q = dispatch_queue_create("my.queue", DISPATCH_QUEUE_CONCURRENT); global = 42; |