mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 03:01:36 +08:00
UAVCAN: Initialize thread attributes correctly
This commit is contained in:
@@ -188,9 +188,12 @@ int UavcanServers::start(uavcan::INode &main_node)
|
|||||||
struct sched_param param;
|
struct sched_param param;
|
||||||
|
|
||||||
pthread_attr_init(&tattr);
|
pthread_attr_init(&tattr);
|
||||||
|
(void)pthread_attr_getschedparam(&tattr, ¶m);
|
||||||
tattr.stacksize = StackSize;
|
tattr.stacksize = StackSize;
|
||||||
param.sched_priority = Priority;
|
param.sched_priority = Priority;
|
||||||
pthread_attr_setschedparam(&tattr, ¶m);
|
if (pthread_attr_setschedparam(&tattr, ¶m)) {
|
||||||
|
warnx("setting sched params failed");
|
||||||
|
}
|
||||||
|
|
||||||
static auto run_trampoline = [](void *) {return UavcanServers::_instance->run(_instance);};
|
static auto run_trampoline = [](void *) {return UavcanServers::_instance->run(_instance);};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user