SDLOG2: Initialize thread attrs correctly

This commit is contained in:
Lorenz Meier
2015-12-03 14:28:05 +01:00
parent e1a5efb9a5
commit 672a7b7b5c
+4 -1
View File
@@ -686,9 +686,12 @@ void sdlog2_start_log()
pthread_attr_init(&logwriter_attr);
struct sched_param param;
(void)pthread_attr_getschedparam(&logwriter_attr, &param);
/* low priority, as this is expensive disk I/O */
param.sched_priority = SCHED_PRIORITY_DEFAULT - 40;
(void)pthread_attr_setschedparam(&logwriter_attr, &param);
if (pthread_attr_setschedparam(&logwriter_attr, &param)) {
warnx("sdlog2: failed setting sched params");
}
pthread_attr_setstacksize(&logwriter_attr, 2048);