sched: inherit parent priority by default
fix ltp pthread_cond_wait_1 test question, child should inherit parent priority by default. nsh> ltp_pthread_cond_wait_1 Error: the policy or priority not correct Signed-off-by: yangyalei <yangyalei@xiaomi.com>
This commit is contained in:
parent
fde8affe71
commit
b2a9c6a3e5
@ -185,14 +185,21 @@ int nx_pthread_create(pthread_trampoline_t trampoline, FAR pthread_t *thread,
|
||||
pid_t pid;
|
||||
int ret;
|
||||
bool group_joined = false;
|
||||
pthread_attr_t default_attr = g_default_pthread_attr;
|
||||
|
||||
DEBUGASSERT(trampoline != NULL);
|
||||
|
||||
parent = this_task();
|
||||
DEBUGASSERT(parent != NULL);
|
||||
|
||||
/* If attributes were not supplied, use the default attributes */
|
||||
|
||||
if (!attr)
|
||||
{
|
||||
attr = &g_default_pthread_attr;
|
||||
/* Inherit parent priority by default */
|
||||
|
||||
default_attr.priority = parent->sched_priority;
|
||||
attr = &default_attr;
|
||||
}
|
||||
|
||||
/* Allocate a TCB for the new task. */
|
||||
@ -395,9 +402,6 @@ int nx_pthread_create(pthread_trampoline_t trampoline, FAR pthread_t *thread,
|
||||
}
|
||||
#endif
|
||||
|
||||
parent = this_task();
|
||||
DEBUGASSERT(parent != NULL);
|
||||
|
||||
/* Configure the TCB for a pthread receiving on parameter
|
||||
* passed by value
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user