aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-04-09 17:32:55 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2018-04-09 17:33:10 +0200
commita7cbe38ae2dd7e983a5e1bc31524fa9bd791727e (patch)
tree9ff80ec448db8ed7f380fb8f8b8b15205a141192
parent603975b96a1542006f738a564171f98e264d32bf (diff)
parentb86730a4d74471378fbafb2bac9839110f520b76 (diff)
Merge #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 #12915. Tree-SHA512: 249e93b1ae7e3ba28de6ee6288400b91d21ca1b4ca41d82211f6c9609b62deb5ac87182c7bf08471d3a3e0c1af314c9ecd41f8ae864febe963b1de8a816dd82f
-rw-r--r--src/util.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 393cc413d6..f55c9c8c34 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -1064,8 +1064,8 @@ fs::path AbsPathForConfigVal(const fs::path& path, bool net_specific)
int ScheduleBatchPriority(void)
{
#ifdef SCHED_BATCH
- const static sched_param param{.sched_priority = 0};
- if (int ret = pthread_setschedparam(0, SCHED_BATCH, &param)) {
+ const static sched_param param{0};
+ if (int ret = pthread_setschedparam(pthread_self(), SCHED_BATCH, &param)) {
LogPrintf("Failed to pthread_setschedparam: %s\n", strerror(errno));
return ret;
}