From 30367fd4cdc86d5ff48e87f2ba3bdc06ff5f18f3 Mon Sep 17 00:00:00 2001 From: yangyalei Date: Thu, 29 Jun 2023 17:08:26 +0800 Subject: [PATCH] sched: inherit parent priority by default, except idle Signed-off-by: yangyalei asdfas Signed-off-by: yangyalei --- sched/pthread/pthread_create.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sched/pthread/pthread_create.c b/sched/pthread/pthread_create.c index df054c9cd26..ae05ea17c30 100644 --- a/sched/pthread/pthread_create.c +++ b/sched/pthread/pthread_create.c @@ -196,9 +196,13 @@ int nx_pthread_create(pthread_trampoline_t trampoline, FAR pthread_t *thread, if (!attr) { - /* Inherit parent priority by default */ + /* Inherit parent priority by default. except idle */ + + if (!is_idle_task(parent)) + { + default_attr.priority = parent->sched_priority; + } - default_attr.priority = parent->sched_priority; attr = &default_attr; }