kernel: fix main/work_q prios in coop/preempt-only modes

-1 is reserved for the idle thread in coop-only mode and -1 does not
exist as a priority in preempt-only mode.

With this change, the philosophers demo runs in preempt-only mode.

Change-Id: Id15a6eafc7582966deaf0db9ed6960b5da74be33
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
This commit is contained in:
Benjamin Walsh 2017-01-14 18:50:22 -05:00 committed by Anas Nashif
commit e669559010

View file

@ -89,7 +89,7 @@ config MAIN_THREAD_PRIORITY
int
prompt "Priority of initialization/main thread"
default 0
default -1 if NUM_PREEMPT_PRIORITIES = 0
default -2 if !PREEMPT_ENABLED
help
Priority at which the initialization thread runs, including the start
of the main() function. main() can then change its priority if desired.
@ -231,6 +231,8 @@ config SYSTEM_WORKQUEUE_STACK_SIZE
config SYSTEM_WORKQUEUE_PRIORITY
int "System workqueue priority"
default -1
default 0 if !COOP_ENABLED
default -2 if COOP_ENABLED && !PREEMPT_ENABLED
config OFFLOAD_WORKQUEUE_STACK_SIZE
int "Workqueue stack size for thread offload requests"