kernel: thread: fix thread priority off-by-one error
Setting CONFIG_NUM_PREEMPT_PRIORITIES to 128 causes the idle thread to be assigned priority 128, which exceeds the int8_t range. This results in the idle thread being assigned the highest priority (-128) instead of the lowest, causing threads to not wake up from k_sleep. Restrict the range of CONFIG_NUM_PREEMPT_PRIORITIES to 0 to 127 to ensure the idle thread always has the lowest priority. Signed-off-by: Jonas Spinner <jonas.spinner@burkert.com>
This commit is contained in:
parent
b8ed4199f8
commit
e3897f0322
1 changed files with 1 additions and 1 deletions
|
@ -53,7 +53,7 @@ config NUM_PREEMPT_PRIORITIES
|
|||
int "Number of preemptible priorities" if MULTITHREADING
|
||||
default 0 if !MULTITHREADING
|
||||
default 15
|
||||
range 0 128
|
||||
range 0 127
|
||||
help
|
||||
Number of preemptible priorities available in the system. Gives access
|
||||
to priorities 0 to CONFIG_NUM_PREEMPT_PRIORITIES - 1.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue