tests: condvar_api: fix permissions to multiple condvar
The permission to use multiple_condvar is not granted to test test_condvar_multiple_threads_wait_wake, which results in bunch or permission error messages, and actually not testing the conditional variables. This grants the permission to the those conditional variables to the test threads. Also, replace the k_yield() with k_msleep() to allow all created threads time to run. A simply k_yield() might let a few to run before the next batch of "waking" threads start to run, resulting in some conditional variables not being initialized but trying to wake. Fixes #34777 Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
376e9cfdff
commit
8b7252cd41
1 changed files with 2 additions and 1 deletions
|
@ -369,7 +369,7 @@ void test_multiple_condvar_wait_wake(void)
|
|||
}
|
||||
|
||||
/* giving time for the other threads to execute */
|
||||
k_yield();
|
||||
k_msleep(10);
|
||||
|
||||
for (int i = 0; i < TOTAL_THREADS_WAITING; i++) {
|
||||
k_thread_create(&multiple_wake_tid[i], multiple_wake_stack[i],
|
||||
|
@ -581,6 +581,7 @@ void test_main(void)
|
|||
&multiple_tid[i],
|
||||
&multiple_wake_tid[i],
|
||||
&multiple_stack[i],
|
||||
&multiple_condvar[i],
|
||||
&multiple_wake_stack[i]);
|
||||
}
|
||||
ztest_test_suite(test_condvar,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue