/* Validate that the cooperative thread will not be preempted. 
Create a cooperative thread with priority higher than the current cooperative thread. Make sure that the higher priority thread will not preempt the lower priority cooperative thread.  */
ZTEST(threads_scheduling, test_priority_cooperative)
/* Validate that the cooperative thread will not be preempted. 
Create a cooperative thread with priority higher than the current cooperative thread. Make sure that the higher priority thread will not preempt the lower priority cooperative thread.  */
ZTEST(threads_scheduling, test_priority_cooperative)
{
	int old_prio = k_thread_priority_get(k_current_get());
	last_prio = -1;
	k_thread_priority_set(k_current_get(), last_prio);
	int spawn_prio = last_prio - 1;
	k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
				      thread_entry, NULL, NULL, NULL,
				      spawn_prio, 0, K_NO_WAIT);
	zassert_true(last_prio == k_thread_priority_get(k_current_get()));
	k_sleep(K_MSEC(100));
	zassert_true(last_prio == spawn_prio);
	k_thread_abort(tid);
	k_thread_priority_set(k_current_get(), old_prio);
}