v29.4-roots.4 · Commit 2: [PATCH 02/37] runtime: preserve shared operator controls
src/util/batchpriority.cpp
Before: src/util/batchpriority.cpp · After: src/util/batchpriority.cpp
File metadata
index c73aef1eb48b6b31ce2280f699d13bb442405c7e..3d2680d2c0c49e10ba9b4c6287b0c8e849128707 100644
Download original patch · Release notes
Diff rows 1–27 of 27. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. Before is on the left; after is on the right. Unified view fits narrow screens more easily.
src/util/batchpriority.cpp
CHANGED
|
@@ -2,15 +2,15 @@
|
|
| 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 |
|
|
@@ -20,7 +20,7 @@ void ScheduleBatchPriority()
|
|
| 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 |
}
|
|
|
|
| 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 <util/batchpriority.h>
|
| 6 |
+
|
| 7 |
#include <logging.h>
|
| 8 |
#include <util/syserror.h>
|
| 9 |
|
| 10 |
+
#include <string>
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
#ifndef WIN32
|
| 13 |
+
#include <pthread.h>
|
| 14 |
#include <sched.h>
|
| 15 |
#endif
|
| 16 |
|
|
|
|
| 20 |
const static sched_param param{};
|
| 21 |
const int rc = pthread_setschedparam(pthread_self(), SCHED_BATCH, ¶m);
|
| 22 |
if (rc != 0) {
|
| 23 |
+
LogWarning("Failed to pthread_setschedparam: %s", SysErrorString(rc));
|
| 24 |
}
|
| 25 |
#endif
|
| 26 |
}
|