mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 11:57:28 -03:00
Merge #17604: util: make ScheduleBatchPriority advisory only
d2a3a5cadb
util: make ScheduleBatchPriority advisory only (fanquake) Pull request description: ACKs for top commit: laanwj: ACKd2a3a5cadb
Tree-SHA512: 14e44360bc6b0c0bfd794cb8a744af7d64fb01aa5602fdb392d6c54799a721ef04426e8379b157dd40f2a33c0b6a5248b09d59c865c453ff1f6e3abbafff524e
This commit is contained in:
commit
23cecd6cd5
2 changed files with 3 additions and 9 deletions
|
@ -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, ¶m)) {
|
||||
if (pthread_setschedparam(pthread_self(), SCHED_BATCH, ¶m) != 0) {
|
||||
LogPrintf("Failed to pthread_setschedparam: %s\n", strerror(errno));
|
||||
return ret;
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
return 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
Loading…
Reference in a new issue