File tree Expand file tree Collapse file tree 6 files changed +45
-26
lines changed Expand file tree Collapse file tree 6 files changed +45
-26
lines changed Original file line number Diff line number Diff line change @@ -280,6 +280,7 @@ BITCOIN_CORE_H = \
280
280
txrequest.h \
281
281
undo.h \
282
282
util/asmap.h \
283
+ util/batchpriority.h \
283
284
util/bip32.h \
284
285
util/bitdeque.h \
285
286
util/bytevectorhash.h \
@@ -711,6 +712,7 @@ libbitcoin_util_a_SOURCES = \
711
712
support/cleanse.cpp \
712
713
sync.cpp \
713
714
util/asmap.cpp \
715
+ util/batchpriority.cpp \
714
716
util/bip32.cpp \
715
717
util/bytevectorhash.cpp \
716
718
util/chaintype.cpp \
@@ -963,6 +965,7 @@ libbitcoinkernel_la_SOURCES = \
963
965
txdb.cpp \
964
966
txmempool.cpp \
965
967
uint256.cpp \
968
+ util/batchpriority.cpp \
966
969
util/chaintype.cpp \
967
970
util/check.cpp \
968
971
util/exception.cpp \
@@ -978,7 +981,6 @@ libbitcoinkernel_la_SOURCES = \
978
981
util/string.cpp \
979
982
util/syscall_sandbox.cpp \
980
983
util/syserror.cpp \
981
- util/system.cpp \
982
984
util/thread.cpp \
983
985
util/threadnames.cpp \
984
986
util/time.cpp \
Original file line number Diff line number Diff line change 17
17
#include < signet.h>
18
18
#include < streams.h>
19
19
#include < undo.h>
20
+ #include < util/batchpriority.h>
20
21
#include < util/fs.h>
21
22
#include < util/syscall_sandbox.h>
22
23
#include < util/system.h>
Original file line number Diff line number Diff line change
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
+
17
+ void ScheduleBatchPriority ()
18
+ {
19
+ #ifdef SCHED_BATCH
20
+ const static sched_param param{};
21
+ const int rc = pthread_setschedparam (pthread_self (), SCHED_BATCH, ¶m);
22
+ if (rc != 0 ) {
23
+ LogPrintf (" Failed to pthread_setschedparam: %s\n " , SysErrorString (rc));
24
+ }
25
+ #endif
26
+ }
Original file line number Diff line number Diff line change
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
+ #ifndef BITCOIN_UTIL_BATCHPRIORITY_H
6
+ #define BITCOIN_UTIL_BATCHPRIORITY_H
7
+
8
+ /**
9
+ * On platforms that support it, tell the kernel the calling thread is
10
+ * CPU-intensive and non-interactive. See SCHED_BATCH in sched(7) for details.
11
+ *
12
+ */
13
+ void ScheduleBatchPriority ();
14
+
15
+ #endif // BITCOIN_UTIL_BATCHPRIORITY_H
Original file line number Diff line number Diff line change 7
7
8
8
#include < logging.h>
9
9
#include < util/string.h>
10
- #include < util/syserror.h>
11
10
#include < util/time.h>
12
11
13
- #if (defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__))
14
- #include < pthread.h>
15
- #include < pthread_np.h>
16
- #endif
17
-
18
12
#ifndef WIN32
19
- #include < sched.h>
20
13
#include < sys/stat.h>
21
14
#else
22
15
#include < codecvt>
@@ -112,14 +105,3 @@ int64_t GetStartupTime()
112
105
{
113
106
return nStartupTime;
114
107
}
115
-
116
- void ScheduleBatchPriority ()
117
- {
118
- #ifdef SCHED_BATCH
119
- const static sched_param param{};
120
- const int rc = pthread_setschedparam (pthread_self (), SCHED_BATCH, ¶m);
121
- if (rc != 0 ) {
122
- LogPrintf (" Failed to pthread_setschedparam: %s\n " , SysErrorString (rc));
123
- }
124
- #endif
125
- }
Original file line number Diff line number Diff line change @@ -36,13 +36,6 @@ void runCommand(const std::string& strCommand);
36
36
*/
37
37
int GetNumCores ();
38
38
39
- /* *
40
- * On platforms that support it, tell the kernel the calling thread is
41
- * CPU-intensive and non-interactive. See SCHED_BATCH in sched(7) for details.
42
- *
43
- */
44
- void ScheduleBatchPriority ();
45
-
46
39
namespace util {
47
40
48
41
// ! Simplification of std insertion
You can’t perform that action at this time.
0 commit comments