Skip to content

Commit fcb6694

Browse files
committed
Merge #14839: [rebase] threads: fix unitialized members in sched_param
8928237 threads: fix unitialized members in sched_param (Cory Fields) Pull request description: Rebased theuni's #14342. Building with gcc 8.2 against musl libc, which apparently has more attributes available in its sched_param. The following warnings were produced: warning: missing initializer for member 'sched_param::sched_ss_low_priority' [-Wmissing-field-initializers] warning: missing initializer for member 'sched_param::sched_ss_repl_period' [-Wmissing-field-initializers] warning: missing initializer for member 'sched_param::sched_ss_init_budget' [-Wmissing-field-initializers] warning: missing initializer for member 'sched_param::sched_ss_max_repl' [-Wmissing-field-initializers] Since the current thread may have interesting non-zero values for these fields, we want to be sure to only change the intended one. Query and modify the current sched_param rather than starting from a zeroed one. Tree-SHA512: a0bedbcf0130b3ee8261bb704e4bf6c9b760ad377c8a28c258765d54e54462b76707efc188b936b0a635cdd2bdf6b3b9298ab06ba361dc4806150b670d9702a3
2 parents f71c2ea + 8928237 commit fcb6694

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util/system.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,7 @@ fs::path AbsPathForConfigVal(const fs::path& path, bool net_specific)
12901290
int ScheduleBatchPriority()
12911291
{
12921292
#ifdef SCHED_BATCH
1293-
const static sched_param param{0};
1293+
const static sched_param param{};
12941294
if (int ret = pthread_setschedparam(pthread_self(), SCHED_BATCH, &param)) {
12951295
LogPrintf("Failed to pthread_setschedparam: %s\n", strerror(errno));
12961296
return ret;

0 commit comments

Comments
 (0)