/* Validate behavior of thread when it yields. 
Spawn cooperative threads equal to number of cores, so last thread would be pending, call yield() from main thread. Now, all threads must be executed  */
ZTEST(smp, test_yield_threads)
/* Validate behavior of thread when it yields. 
Spawn cooperative threads equal to number of cores, so last thread would be pending, call yield() from main thread. Now, all threads must be executed  */
ZTEST(smp, test_yield_threads)
{
	unsigned int num_threads = arch_num_cpus();
	spawn_threads(K_PRIO_COOP(10), num_threads, !EQUAL_PRIORITY,
		      &thread_entry_fn, !THREAD_DELAY);
	k_yield();
	k_busy_wait(DELAY_US);
	for (int i = 0; i < num_threads; i++) {
		zassert_true(tinfo[i].executed == 1,
			     "thread %d did not execute", i);
	}
	abort_threads(num_threads);
	cleanup_resources();
}