Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
batchpriority.cpp
Go to the documentation of this file.
1// Copyright (c) 2023 The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#include <logging.h>
6#include <util/syserror.h>
7
8#if (defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__))
9#include <pthread.h>
10#include <pthread_np.h>
11#endif
12
13#ifndef WIN32
14#include <sched.h>
15#endif
16
18#ifdef SCHED_BATCH
19 const static sched_param param{};
21 if (rc != 0) {
22 LogPrintf("Failed to pthread_setschedparam: %s\n", SysErrorString(rc));
23 }
24#endif
25}
void ScheduleBatchPriority()
On platforms that support it, tell the kernel the calling thread is CPU-intensive and non-interactive...
#define LogPrintf(...)
Definition logging.h:227
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition random.h:85
std::string SysErrorString(int err)
Return system error string from errno value.
Definition syserror.cpp:14