aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@protonmail.com>2019-11-28 12:49:19 +0100
committerWladimir J. van der Laan <laanwj@protonmail.com>2019-11-28 12:49:32 +0100
commit23cecd6cd56f952c757f469c46d7593c2ffaa419 (patch)
tree56af7f8b038fbf9094f165073edd77e591f9ae26 /src
parent1f59885d27a0c4812fb1a2324507e2b2e32057d3 (diff)
parentd2a3a5cadbe58c0fe363bbc6acac293d41eedf7e (diff)
downloadbitcoin-23cecd6cd56f952c757f469c46d7593c2ffaa419.tar.xz
Merge #17604: util: make ScheduleBatchPriority advisory only
d2a3a5cadbe58c0fe363bbc6acac293d41eedf7e util: make ScheduleBatchPriority advisory only (fanquake) Pull request description: ACKs for top commit: laanwj: ACK d2a3a5cadbe58c0fe363bbc6acac293d41eedf7e Tree-SHA512: 14e44360bc6b0c0bfd794cb8a744af7d64fb01aa5602fdb392d6c54799a721ef04426e8379b157dd40f2a33c0b6a5248b09d59c865c453ff1f6e3abbafff524e
Diffstat (limited to 'src')
-rw-r--r--src/util/system.cpp8
-rw-r--r--src/util/system.h4
2 files changed, 3 insertions, 9 deletions
diff --git a/src/util/system.cpp b/src/util/system.cpp
index 2a2ae6fdf5..563ff6a54b 100644
--- a/src/util/system.cpp
+++ b/src/util/system.cpp
@@ -1126,17 +1126,13 @@ fs::path AbsPathForConfigVal(const fs::path& path, bool net_specific)
return fs::absolute(path, GetDataDir(net_specific));
}
-int ScheduleBatchPriority()
+void ScheduleBatchPriority()
{
#ifdef SCHED_BATCH
const static sched_param param{};
- if (int ret = pthread_setschedparam(pthread_self(), SCHED_BATCH, &param)) {
+ if (pthread_setschedparam(pthread_self(), SCHED_BATCH, &param) != 0) {
LogPrintf("Failed to pthread_setschedparam: %s\n", strerror(errno));
- return ret;
}
- return 0;
-#else
- return 1;
#endif
}
diff --git a/src/util/system.h b/src/util/system.h
index e0b6371dc9..82903b5187 100644
--- a/src/util/system.h
+++ b/src/util/system.h
@@ -367,10 +367,8 @@ std::string CopyrightHolders(const std::string& strPrefix);
* On platforms that support it, tell the kernel the calling thread is
* CPU-intensive and non-interactive. See SCHED_BATCH in sched(7) for details.
*
- * @return The return value of sched_setschedule(), or 1 on systems without
- * sched_setschedule().
*/
-int ScheduleBatchPriority();
+void ScheduleBatchPriority();
namespace util {