Skip to content

Commit 1984236

Browse files
dcpleungdanieldegrasse
authored andcommitted
kernel: move z_sched_lock inside k_sched_lock
z_sched_lock() has exactly one user in tree which is k_sched_lock(). So combine them to make it easier to follow (or not, since there is no jumping to another file anymore). Signed-off-by: Daniel Leung <[email protected]>
1 parent a2acc86 commit 1984236

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

kernel/include/ksched.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,6 @@ static inline bool _is_valid_prio(int prio, k_thread_entry_t entry_point)
138138
return true;
139139
}
140140

141-
static inline void z_sched_lock(void)
142-
{
143-
__ASSERT(!arch_is_in_isr(), "");
144-
__ASSERT(_current->base.sched_locked != 1U, "");
145-
146-
--_current->base.sched_locked;
147-
148-
compiler_barrier();
149-
}
150-
151141
static ALWAYS_INLINE _wait_q_t *pended_on_thread(struct k_thread *thread)
152142
{
153143
__ASSERT_NO_MSG(thread->base.pended_on);

kernel/sched.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,12 @@ void k_sched_lock(void)
771771
K_SPINLOCK(&_sched_spinlock) {
772772
SYS_PORT_TRACING_FUNC(k_thread, sched_lock);
773773

774-
z_sched_lock();
774+
__ASSERT(!arch_is_in_isr(), "");
775+
__ASSERT(_current->base.sched_locked != 1U, "");
776+
777+
--_current->base.sched_locked;
778+
779+
compiler_barrier();
775780
}
776781
}
777782

0 commit comments

Comments
 (0)