/* Spawn thread with forever delay and highest priority. 
Create an user thread with forever delay and yield the current thread. Even though the current thread has yielded, the thread will not be put in ready queue since it has forever delay, the thread is explicitly started using k_thread_start() and checked if thread has started executing. */
ZTEST(threads_lifecycle, test_threads_spawn_forever)
/* Spawn thread with forever delay and highest priority. 
Create an user thread with forever delay and yield the current thread. Even though the current thread has yielded, the thread will not be put in ready queue since it has forever delay, the thread is explicitly started using k_thread_start() and checked if thread has started executing. */
ZTEST(threads_lifecycle, test_threads_spawn_forever)
{
	tp2 = 10;
	k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
				      thread_entry_delay, NULL, NULL, NULL,
				      K_HIGHEST_THREAD_PRIO,
				      K_USER, K_FOREVER);
	k_yield();
	zassert_true(tp2 == 10);
	k_thread_start(tid);
	k_yield();
	zassert_true(tp2 == 100);
	k_thread_abort(tid);
}