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:
Enjia Mai 2021-04-25 15:55:42 +08:00 committed by Anas Nashif
commit d3747db66f

View file

@ -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);