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:
parent
e9f1ce7e32
commit
068e1877b8
@ -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");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user