tests: kernel: fix two test cases of condvar hang up in SMP
Make some change on two codvar test cases to fit testing under SMP, and shorter the test cases execution time. Fixes #33558. Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
This commit is contained in:
parent
2e1ac6b46b
commit
d3747db66f
1 changed files with 4 additions and 1 deletions
|
@ -511,7 +511,7 @@ void inc_count(void *p1, void *p2, void *p3)
|
|||
k_mutex_unlock(&test_mutex);
|
||||
|
||||
/* Sleep so threads can alternate on mutex lock */
|
||||
k_sleep(K_MSEC(200));
|
||||
k_sleep(K_MSEC(50));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -536,6 +536,9 @@ void _condvar_usecase(long multi)
|
|||
|
||||
count = 0;
|
||||
|
||||
/* Reinit mutex to prevent affection from previous testcases */
|
||||
k_mutex_init(&test_mutex);
|
||||
|
||||
k_thread_create(&multiple_tid[0], multiple_stack[0], STACK_SIZE, watch_count,
|
||||
INT_TO_POINTER(t1), NULL, NULL, K_PRIO_PREEMPT(10),
|
||||
K_USER | K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue