/* Lock the scheduler when preemptive threads are running. 
Create 3 threads and lock the scheduler. Make sure that the threads are not executed. Call k_sleep() and check if the threads have executed.  */
ZTEST(threads_scheduling, test_lock_preemptible)
/* Lock the scheduler when preemptive threads are running. 
Create 3 threads and lock the scheduler. Make sure that the threads are not executed. Call k_sleep() and check if the threads have executed.  */
ZTEST(threads_scheduling, test_lock_preemptible)
{
	init_prio = 0;
	setup_threads();
	k_sched_lock();
	spawn_threads(0);
	k_busy_wait(100000);
	for (int i = 0; i < THREADS_NUM; i++) {
		zassert_true(tdata[i].executed == 0);
	}
	k_sleep(K_MSEC(100));
	for (int i = 0; i < THREADS_NUM; i++) {
		zassert_true(tdata[i].executed == 1);
	}
	teardown_threads();
}