lib: posix: Fix priority validity check in pthread_setschedparam
New priority value check was faultly done on zephyr priority instead of posix one. Signed-off-by: Jan Pohanka <xhpohanka@gmail.com>
This commit is contained in:
parent
9df168b535
commit
9e462469b4
1 changed files with 3 additions and 3 deletions
|
@ -277,12 +277,12 @@ int pthread_setschedparam(pthread_t pthread, int policy,
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
new_prio = posix_to_zephyr_priority(param->sched_priority, policy);
|
if (is_posix_prio_valid(param->sched_priority, policy) == false) {
|
||||||
|
|
||||||
if (is_posix_prio_valid(new_prio, policy) == false) {
|
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
new_prio = posix_to_zephyr_priority(param->sched_priority, policy);
|
||||||
|
|
||||||
k_thread_priority_set(thread, new_prio);
|
k_thread_priority_set(thread, new_prio);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue