aboutsummaryrefslogtreecommitdiff
path: root/test/asan/TestCases/Posix/concurrent_overflow.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/asan/TestCases/Posix/concurrent_overflow.cc')
-rw-r--r--test/asan/TestCases/Posix/concurrent_overflow.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/asan/TestCases/Posix/concurrent_overflow.cc b/test/asan/TestCases/Posix/concurrent_overflow.cc
index e9b9899c31a2..345b546851ba 100644
--- a/test/asan/TestCases/Posix/concurrent_overflow.cc
+++ b/test/asan/TestCases/Posix/concurrent_overflow.cc
@@ -20,11 +20,12 @@ static void *start_routine(void *arg) {
int main(void) {
const int n_threads = 8;
int i, counter = n_threads;
- pthread_t thread;
+ pthread_t thread[n_threads];
for (i = 0; i < n_threads; ++i)
- pthread_create(&thread, NULL, &start_routine, (void *)&counter);
- sleep(5);
+ pthread_create(&thread[i], NULL, &start_routine, (void *)&counter);
+ for (i = 0; i < n_threads; ++i)
+ pthread_join(thread[i], NULL);
return 0;
}