Lines Matching refs:thread
25 static inline int slice_time(struct k_thread *thread) in slice_time() argument
30 if (thread->base.slice_ticks != 0) { in slice_time()
31 ret = thread->base.slice_ticks; in slice_time()
34 ARG_UNUSED(thread); in slice_time()
39 bool thread_is_sliceable(struct k_thread *thread) in thread_is_sliceable() argument
41 bool ret = thread_is_preemptible(thread) in thread_is_sliceable()
42 && slice_time(thread) != 0 in thread_is_sliceable()
43 && !z_is_prio_higher(thread->base.prio, slice_max_prio) in thread_is_sliceable()
44 && !z_is_thread_prevented_from_running(thread) in thread_is_sliceable()
45 && !z_is_idle_thread_object(thread); in thread_is_sliceable()
48 ret |= thread->base.slice_ticks != 0; in thread_is_sliceable()
68 void z_reset_time_slice(struct k_thread *thread) in z_reset_time_slice() argument
74 if (thread_is_sliceable(thread)) { in z_reset_time_slice()
76 K_TICKS(slice_time(thread) - 1)); in z_reset_time_slice()
90 void k_thread_time_slice_set(struct k_thread *thread, int32_t thread_slice_ticks, in k_thread_time_slice_set() argument
94 thread->base.slice_ticks = thread_slice_ticks; in k_thread_time_slice_set()
95 thread->base.slice_expired = expired; in k_thread_time_slice_set()
96 thread->base.slice_data = data; in k_thread_time_slice_set()
97 z_reset_time_slice(thread); in k_thread_time_slice_set()