mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-28 06:10:35 +08:00
SDLOG2: Initialize thread attrs correctly
This commit is contained in:
@@ -686,9 +686,12 @@ void sdlog2_start_log()
|
||||
pthread_attr_init(&logwriter_attr);
|
||||
|
||||
struct sched_param param;
|
||||
(void)pthread_attr_getschedparam(&logwriter_attr, ¶m);
|
||||
/* low priority, as this is expensive disk I/O */
|
||||
param.sched_priority = SCHED_PRIORITY_DEFAULT - 40;
|
||||
(void)pthread_attr_setschedparam(&logwriter_attr, ¶m);
|
||||
if (pthread_attr_setschedparam(&logwriter_attr, ¶m)) {
|
||||
warnx("sdlog2: failed setting sched params");
|
||||
}
|
||||
|
||||
pthread_attr_setstacksize(&logwriter_attr, 2048);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user