Fix deadlock.mm test: Avoid using a 10.12+ API on NSThread.
diff --git a/test/tsan/Darwin/deadlock.mm b/test/tsan/Darwin/deadlock.mm
index a0715b6..36ddfad 100644
--- a/test/tsan/Darwin/deadlock.mm
+++ b/test/tsan/Darwin/deadlock.mm
@@ -15,15 +15,15 @@
pthread_mutex_init(&m1, NULL);
pthread_mutex_init(&m2, NULL);
- [NSThread detachNewThreadWithBlock:^{
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
pthread_mutex_lock(&m1);
pthread_mutex_lock(&m2);
pthread_mutex_unlock(&m2);
pthread_mutex_unlock(&m1);
barrier_wait(&barrier);
- }];
- [NSThread detachNewThreadWithBlock:^{
+ });
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
barrier_wait(&barrier);
pthread_mutex_lock(&m2);
@@ -34,7 +34,7 @@
dispatch_sync(dispatch_get_main_queue(), ^{
CFRunLoopStop(CFRunLoopGetCurrent());
});
- }];
+ });
CFRunLoopRun();