Skip to content

Commit 23cecd6

Browse files
committed
Merge bitcoin#17604: util: make ScheduleBatchPriority advisory only
d2a3a5c util: make ScheduleBatchPriority advisory only (fanquake) Pull request description: ACKs for top commit: laanwj: ACK d2a3a5c Tree-SHA512: 14e44360bc6b0c0bfd794cb8a744af7d64fb01aa5602fdb392d6c54799a721ef04426e8379b157dd40f2a33c0b6a5248b09d59c865c453ff1f6e3abbafff524e
2 parents 1f59885 + d2a3a5c commit 23cecd6

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/util/system.cpp

+2-6
Original file line numberDiff line numberDiff line change
@@ -1126,17 +1126,13 @@ fs::path AbsPathForConfigVal(const fs::path& path, bool net_specific)
11261126
return fs::absolute(path, GetDataDir(net_specific));
11271127
}
11281128

1129-
int ScheduleBatchPriority()
1129+
void ScheduleBatchPriority()
11301130
{
11311131
#ifdef SCHED_BATCH
11321132
const static sched_param param{};
1133-
if (int ret = pthread_setschedparam(pthread_self(), SCHED_BATCH, &param)) {
1133+
if (pthread_setschedparam(pthread_self(), SCHED_BATCH, &param) != 0) {
11341134
LogPrintf("Failed to pthread_setschedparam: %s\n", strerror(errno));
1135-
return ret;
11361135
}
1137-
return 0;
1138-
#else
1139-
return 1;
11401136
#endif
11411137
}
11421138

src/util/system.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,8 @@ std::string CopyrightHolders(const std::string& strPrefix);
367367
* On platforms that support it, tell the kernel the calling thread is
368368
* CPU-intensive and non-interactive. See SCHED_BATCH in sched(7) for details.
369369
*
370-
* @return The return value of sched_setschedule(), or 1 on systems without
371-
* sched_setschedule().
372370
*/
373-
int ScheduleBatchPriority();
371+
void ScheduleBatchPriority();
374372

375373
namespace util {
376374

0 commit comments

Comments
 (0)