aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-04-09 15:44:46 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2018-04-09 15:44:46 +0200
commitcff66e6a29d700188f6ecebeaacc8bcaa1fc1095 (patch)
tree5af60a221233d381e99e9a73430efc761edfbf78 /src/util.cpp
parent603975b96a1542006f738a564171f98e264d32bf (diff)
downloadbitcoin-cff66e6a29d700188f6ecebeaacc8bcaa1fc1095.tar.xz
util: Pass pthread_self() to pthread_setschedparam instead of 0
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)
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 393cc413d6..3043f6b9a3 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -1065,7 +1065,7 @@ int ScheduleBatchPriority(void)
{
#ifdef SCHED_BATCH
const static sched_param param{.sched_priority = 0};
- if (int ret = pthread_setschedparam(0, SCHED_BATCH, &param)) {
+ if (int ret = pthread_setschedparam(pthread_self(), SCHED_BATCH, &param)) {
LogPrintf("Failed to pthread_setschedparam: %s\n", strerror(errno));
return ret;
}