Lines Matching +full:idle +full:- +full:count
4 * SPDX-License-Identifier: Apache-2.0
39 /* Choose a random preemptible priority higher than the idle in stress_sub()
43 item->item.priority = sys_rand32_get() % (K_LOWEST_THREAD_PRIO - 1); in stress_sub()
44 item->item.deadline = sys_rand32_get() % k_ms_to_cyc_ceil32(2); in stress_sub()
45 item->item.handler = stress_handler; in stress_sub()
46 item->running = false; in stress_sub()
47 item->active = true; in stress_sub()
49 k_p4wq_submit(&wq, &item->item); in stress_sub()
57 titem->running = true; in stress_handler()
61 zassert_true(curr_pri == item->priority, in stress_handler()
63 item->priority, curr_pri); in stress_handler()
70 active_items--; in stress_handler()
72 /* Pick 0-3 random item slots and submit them if they aren't in stress_handler()
90 titem->active = false; in stress_handler()
103 k_thread_priority_set(k_current_get(), -1); in ZTEST()
108 items[0].item.priority = -1; in ZTEST()
121 /* Whitebox: count the number of BLOCKED threads, because the in active_count()
126 int count = 0; in active_count() local
130 count++; in active_count()
133 count = MAX_NUM_THREADS - count; in active_count()
134 return count; in active_count()
155 item->priority = pri; in add_new_item()
156 item->deadline = k_us_to_cyc_ceil32(100); in add_new_item()
157 item->handler = spin_handler; in add_new_item()
174 /* The work item priorities are 0-4, this thread should be -1 in ZTEST()
177 k_thread_priority_set(k_current_get(), -1); in ZTEST()
179 /* Spawn enough threads so the queue saturates the CPU count in ZTEST()
198 for (int pri = p0 - 1; pri >= p0 - 4; pri++) { in ZTEST()
211 /* Clean up and wait for the threads to be idle */ in ZTEST()
241 zassert_equal(run_count, 2, "Wrong run count: %d\n", run_count); in ZTEST()
268 zassert_true(has_run, "low-priority item didn't run"); in ZTEST()
272 simple_item.priority = prio - 1; in ZTEST()
274 zassert_true(has_run, "high-priority item didn't run"); in ZTEST()