From c66fcf47e054504d873f7a7a3c330279c3c68720 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 6 May 2016 10:03:57 +0200 Subject: [PATCH] Merge #8011: don't run ThreadMessageHandler at lowered priority e53e7c5 don't run ThreadMessageHandler at lowered priority (Kaz Wesley) --- src/compat.h | 11 ----------- src/net.cpp | 1 - src/util.cpp | 13 ------------- src/util.h | 1 - 4 files changed, 26 deletions(-) diff --git a/src/compat.h b/src/compat.h index 5c15e3306c..718e3f7515 100644 --- a/src/compat.h +++ b/src/compat.h @@ -78,17 +78,6 @@ typedef u_int SOCKET; #define MSG_NOSIGNAL 0 #endif -#ifndef WIN32 -// PRIO_MAX is not defined on Solaris -#ifndef PRIO_MAX -#define PRIO_MAX 20 -#endif -#define THREAD_PRIORITY_LOWEST PRIO_MAX -#define THREAD_PRIORITY_BELOW_NORMAL 2 -#define THREAD_PRIORITY_NORMAL 0 -#define THREAD_PRIORITY_ABOVE_NORMAL (-2) -#endif - #if HAVE_DECL_STRNLEN == 0 size_t strnlen( const char *start, size_t max_len); #endif // HAVE_DECL_STRNLEN diff --git a/src/net.cpp b/src/net.cpp index bac1987bfc..da00b6b620 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1919,7 +1919,6 @@ bool CConnman::OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGran void CConnman::ThreadMessageHandler() { - SetThreadPriority(THREAD_PRIORITY_BELOW_NORMAL); while (!flagInterruptMsgProc) { std::vector vNodesCopy = CopyNodeVector(); diff --git a/src/util.cpp b/src/util.cpp index ae10b55e62..3c15151f6b 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -910,19 +910,6 @@ bool SetupNetworking() return true; } -void SetThreadPriority(int nPriority) -{ -#ifdef WIN32 - SetThreadPriority(GetCurrentThread(), nPriority); -#else // WIN32 -#ifdef PRIO_THREAD - setpriority(PRIO_THREAD, 0, nPriority); -#else // PRIO_THREAD - setpriority(PRIO_PROCESS, 0, nPriority); -#endif // PRIO_THREAD -#endif // WIN32 -} - int GetNumCores() { #if BOOST_VERSION >= 105600 diff --git a/src/util.h b/src/util.h index 647cb2b3f7..6d582f8d1d 100644 --- a/src/util.h +++ b/src/util.h @@ -231,7 +231,6 @@ std::string HelpMessageOpt(const std::string& option, const std::string& message */ int GetNumCores(); -void SetThreadPriority(int nPriority); void RenameThread(const char* name); std::string GetThreadName();