Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AP_HAL_Linux: Scheduler: Use pthread_* over sched_* calls for setsche…
…dparam musl implements `sched_*` following the posix standard, where `sched_setschedule` is used for process scheduling. Linux implementation defines `sched_*` functions based in the thread scheduler and not with the process. Using `pthread_*` should be used to follow such standard. Ref: https://pubs.opengroup.org/onlinepubs/9699919799/ From: https://www.openwall.com/lists/musl/2016/03/01/5 > ... Linux does not provide a way > to set scheduling parameters for a _process_, only for threads. The > sched_setscheduler syscall is documented as taking a pid but actually > takes a thread id and only operates on that thread. glibc just ignores > this and provides sched_* functions that do the wrong thing. This can be fixed by using `pthread_setschedparam` and requesting the current thread id via `pthread_self`. Signed-off-by: Patrick José Pereira <[email protected]>
- Loading branch information