kernel: thread: rename is_preempt

Trivila rename to thread_is_preempt.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2024-03-28 07:20:51 -04:00
parent 6754cbd1b5
commit 5c170c7046
4 changed files with 5 additions and 5 deletions

View file

@ -49,7 +49,7 @@ static inline void thread_schedule_new(struct k_thread *thread, k_timeout_t dela
} }
#endif /* CONFIG_MULTITHREADING */ #endif /* CONFIG_MULTITHREADING */
static inline int is_preempt(struct k_thread *thread) static inline int thread_is_preemptible(struct k_thread *thread)
{ {
/* explanation in kernel_struct.h */ /* explanation in kernel_struct.h */
return thread->base.preempt <= _PREEMPT_THRESHOLD; return thread->base.preempt <= _PREEMPT_THRESHOLD;
@ -209,7 +209,7 @@ static ALWAYS_INLINE bool should_preempt(struct k_thread *thread,
/* Otherwise we have to be running a preemptible thread or /* Otherwise we have to be running a preemptible thread or
* switching to a metairq * switching to a metairq
*/ */
if (is_preempt(_current) || thread_is_metairq(thread)) { if (thread_is_preemptible(_current) || thread_is_metairq(thread)) {
return true; return true;
} }

View file

@ -334,7 +334,7 @@ static void update_metairq_preempt(struct k_thread *thread)
#if (CONFIG_NUM_METAIRQ_PRIORITIES > 0) && \ #if (CONFIG_NUM_METAIRQ_PRIORITIES > 0) && \
(CONFIG_NUM_COOP_PRIORITIES > CONFIG_NUM_METAIRQ_PRIORITIES) (CONFIG_NUM_COOP_PRIORITIES > CONFIG_NUM_METAIRQ_PRIORITIES)
if (thread_is_metairq(thread) && !thread_is_metairq(_current) && if (thread_is_metairq(thread) && !thread_is_metairq(_current) &&
!is_preempt(_current)) { !thread_is_preemptible(_current)) {
/* Record new preemption */ /* Record new preemption */
_current_cpu->metairq_preempted = _current; _current_cpu->metairq_preempted = _current;
} else if (!thread_is_metairq(thread) && !z_is_idle_thread_object(thread)) { } else if (!thread_is_metairq(thread) && !z_is_idle_thread_object(thread)) {

View file

@ -110,7 +110,7 @@ static inline void *z_vrfy_k_thread_custom_data_get(void)
int z_impl_k_is_preempt_thread(void) int z_impl_k_is_preempt_thread(void)
{ {
return !arch_is_in_isr() && is_preempt(_current); return !arch_is_in_isr() && thread_is_preemptible(_current);
} }
#ifdef CONFIG_USERSPACE #ifdef CONFIG_USERSPACE

View file

@ -38,7 +38,7 @@ static inline int slice_time(struct k_thread *thread)
bool thread_is_sliceable(struct k_thread *thread) bool thread_is_sliceable(struct k_thread *thread)
{ {
bool ret = is_preempt(thread) bool ret = thread_is_preemptible(thread)
&& slice_time(thread) != 0 && slice_time(thread) != 0
&& !z_is_prio_higher(thread->base.prio, slice_max_prio) && !z_is_prio_higher(thread->base.prio, slice_max_prio)
&& !z_is_thread_prevented_from_running(thread) && !z_is_thread_prevented_from_running(thread)