kernel: Remove k_thread_priority_set() restriction

Removes the ISR restriction from k_thread_priority_set().
Since the first commit, the routine k_thread_priority_set() has
had a restriction preventing it from being called from within
the context of an ISR. As there does not (any longer) appear to
be a reason why the restriction exists, it is being removed.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
This commit is contained in:
Peter Mitsis 2024-07-30 13:00:15 -07:00 committed by Anas Nashif
commit 8c48665868
2 changed files with 5 additions and 6 deletions

View file

@ -904,12 +904,12 @@ __syscall int k_thread_priority_get(k_tid_t thread);
* Rescheduling can occur immediately depending on the priority @a thread is
* set to:
*
* - If its priority is raised above the priority of the caller of this
* function, and the caller is preemptible, @a thread will be scheduled in.
* - If its priority is raised above the priority of a currently scheduled
* preemptible thread, @a thread will be scheduled in.
*
* - If the caller operates on itself, it lowers its priority below that of
* other threads in the system, and the caller is preemptible, the thread of
* highest priority will be scheduled in.
* - If the caller lowers the priority of a currently scheduled preemptible
* thread below that of other threads in the system, the thread of the highest
* priority will be scheduled in.
*
* Priority can be assigned in the range of -CONFIG_NUM_COOP_PRIORITIES to
* CONFIG_NUM_PREEMPT_PRIORITIES-1, where -CONFIG_NUM_COOP_PRIORITIES is the

View file

@ -1038,7 +1038,6 @@ void z_impl_k_thread_priority_set(k_tid_t thread, int prio)
* keep track of it) and idle cannot change its priority.
*/
Z_ASSERT_VALID_PRIO(prio, NULL);
__ASSERT(!arch_is_in_isr(), "");
bool need_sched = z_thread_prio_set((struct k_thread *)thread, prio);