testing: getprime: Fix the thread number info
Summary: - I noticed that getprime sometimes shows a wrong thread number - This commit fixes this issue Impact: - None Testing: - Tested with sabre-6quad:netnsh Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
parent
4d86c69a22
commit
1bf462e1c1
@ -114,6 +114,7 @@ static void get_prime_in_parallel(int n)
|
||||
pthread_t thread[MAX_THREADS];
|
||||
pthread_attr_t attr;
|
||||
pthread_addr_t result;
|
||||
int arg[MAX_THREADS];
|
||||
int status;
|
||||
int i;
|
||||
|
||||
@ -141,9 +142,10 @@ static void get_prime_in_parallel(int n)
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
arg[i] = i;
|
||||
printf("Start thread #%d\n", i);
|
||||
status = pthread_create(&thread[i], &attr,
|
||||
thread_func, (FAR void *)&i);
|
||||
thread_func, (FAR void *)&arg[i]);
|
||||
ASSERT(status == OK);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user