Skip to content

Commit a847883

Browse files
laanwjgades
authored andcommitted
Merge bitcoin#12923: util: Pass pthread_self() to pthread_setschedparam instead of 0
b86730a util: Remove designator initializer from ScheduleBatchPriority (Wladimir J. van der Laan) cff66e6 util: Pass pthread_self() to pthread_setschedparam instead of 0 (Wladimir J. van der Laan) Pull request description: Nowhere in the man page of `pthread_setschedparam` it is mentioned that `0` is a valid value. The example uses `pthread_self()`, so should we. (noticed by Anthony Towns) Fixes bitcoin#12915. Tree-SHA512: 249e93b1ae7e3ba28de6ee6288400b91d21ca1b4ca41d82211f6c9609b62deb5ac87182c7bf08471d3a3e0c1af314c9ecd41f8ae864febe963b1de8a816dd82f
1 parent 277759c commit a847883

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/util.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,8 +1180,8 @@ fs::path AbsPathForConfigVal(const fs::path& path, bool net_specific)
11801180
int ScheduleBatchPriority(void)
11811181
{
11821182
#ifdef SCHED_BATCH
1183-
const static sched_param param{.sched_priority = 0};
1184-
if (int ret = pthread_setschedparam(0, SCHED_BATCH, &param)) {
1183+
const static sched_param param{0};
1184+
if (int ret = pthread_setschedparam(pthread_self(), SCHED_BATCH, &param)) {
11851185
LogPrintf("Failed to pthread_setschedparam: %s\n", strerror(errno));
11861186
return ret;
11871187
}

0 commit comments

Comments
 (0)