1 // RUN: %clangxx_tsan %s -o %t
2 // RUN: %t 2>&1 | FileCheck %s
7 const int kStride
= 16;
10 for (int i
= 0; i
< bench_niter
; i
++) {
11 pthread_mutex_lock(&mtx
[tid
* kStride
]);
12 pthread_mutex_unlock(&mtx
[tid
* kStride
]);
17 mtx
= (pthread_mutex_t
*)malloc(bench_nthread
* kStride
* sizeof(*mtx
));
18 for (int i
= 0; i
< bench_nthread
; i
++) {
19 pthread_mutex_init(&mtx
[i
* kStride
], 0);
20 pthread_mutex_lock(&mtx
[i
* kStride
]);
21 pthread_mutex_unlock(&mtx
[i
* kStride
]);
23 start_thread_group(bench_nthread
, thread
);