mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
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
1 changed files with 5 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue