bitcoin/src/util/batchpriority.cpp
stickies-v 37cc2a2d95 logging: use util/log.h where possible
Preparation for a future commit where kernel's dependency
on logging.cpp is removed completely.

Replace usage of logging\.h with util/log\.h where it
suffices, and fix wrong includes according to iwyu.
2026-02-02 17:22:31 +00:00

27 lines
642 B
C++

// Copyright (c) 2023-present The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <util/batchpriority.h>
#include <util/log.h>
#include <util/syserror.h>
#include <string>
#ifndef WIN32
#include <pthread.h>
#include <sched.h>
#endif
void ScheduleBatchPriority()
{
#ifdef SCHED_BATCH
const static sched_param param{};
const int rc = pthread_setschedparam(pthread_self(), SCHED_BATCH, &param);
if (rc != 0) {
LogWarning("Failed to pthread_setschedparam: %s", SysErrorString(rc));
}
#endif
}