testing: getprime: Fix to wait for all the threads to finish

Summary:
- I noticed that sometimes getprime causes ASSERT in tls_getset.c
- This commit fixes this issue.

Impact:
- None

Testing:
- Tested with spresense:wifi_smp

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
Masayuki Ishikawa 2021-06-08 10:35:54 +09:00 committed by patacongo
parent e9f1ce7e32
commit 068e1877b8

View File

@ -147,9 +147,12 @@ static void get_prime_in_parallel(int n)
ASSERT(status == OK);
}
/* Wait for finishing the last thread */
/* Wait for all the threads to finish */
pthread_join(thread[n - 1], &result);
for (i = 0; i < n; i++)
{
pthread_join(thread[i], &result);
}
printf("Done\n");
}