/* Validate the correctness of k_is_preempt_thread() 
Create a preemptive thread, lock the scheduler and call k_is_preempt_thread(). Unlock the scheduler and call k_is_preempt_thread() again. Create a cooperative thread and lock the scheduler k_is_preempt_thread() and unlock the scheduler and call k_is_preempt_thread(). */
ZTEST(threads_scheduling, test_sched_is_preempt_thread)
/* Validate the correctness of k_is_preempt_thread() 
Create a preemptive thread, lock the scheduler and call k_is_preempt_thread(). Unlock the scheduler and call k_is_preempt_thread() again. Create a cooperative thread and lock the scheduler k_is_preempt_thread() and unlock the scheduler and call k_is_preempt_thread(). */
ZTEST(threads_scheduling, test_sched_is_preempt_thread)
{
	k_sem_init(&end_sema, 0, 1);
	k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
				      tpreempt_ctx, NULL, NULL, NULL,
				      K_PRIO_PREEMPT(1), 0, K_NO_WAIT);
	k_sem_take(&end_sema, K_FOREVER);
	k_thread_abort(tid);
	tid = k_thread_create(&tdata, tstack, STACK_SIZE,
			      tcoop_ctx, NULL, NULL, NULL,
			      K_PRIO_COOP(1), 0, K_NO_WAIT);
	k_sem_take(&end_sema, K_FOREVER);
	k_thread_abort(tid);
	irq_offload(tIsr, NULL);
}