mirror of
https://github.com/intel/llvm.git
synced 2026-02-05 13:21:04 +08:00
[tsan] Fix hanging gcd-apply and gcd-apply-race tests on macOS Sierra
llvm-svn: 281462
This commit is contained in:
@@ -10,6 +10,10 @@ long global;
|
||||
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);
|
||||
dispatch_apply(2, q, ^(size_t i) {
|
||||
global = i;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user