diff options
author | Kaz Wesley <keziahw@gmail.com> | 2016-05-05 11:55:46 -0700 |
---|---|---|
committer | Kaz Wesley <keziahw@gmail.com> | 2016-05-05 13:25:35 -0700 |
commit | e53e7c54736b98098553ba1a5191e093684f9114 (patch) | |
tree | 8849c71c722c0ec652da7bf4b062d8c5900a09dc | |
parent | 3b9a0bf41f2336b09e854522ab1ce6dcfc7a3050 (diff) |
don't run ThreadMessageHandler at lowered priority
There's no clear reason ThreadMessageHandler should be low priority.
Fixes #8010 (priority inversion).
-rw-r--r-- | src/compat.h | 11 | ||||
-rw-r--r-- | src/net.cpp | 1 | ||||
-rw-r--r-- | src/util.cpp | 13 | ||||
-rw-r--r-- | src/util.h | 1 |
4 files changed, 0 insertions, 26 deletions
diff --git a/src/compat.h b/src/compat.h index 1225ea18ed..79a297e5e4 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 6642ef6515..5e810a0f15 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1729,7 +1729,6 @@ void ThreadMessageHandler() boost::mutex condition_mutex; boost::unique_lock<boost::mutex> lock(condition_mutex); - SetThreadPriority(THREAD_PRIORITY_BELOW_NORMAL); while (true) { vector<CNode*> vNodesCopy; diff --git a/src/util.cpp b/src/util.cpp index 00b75fbdbe..3f0f8be544 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -790,19 +790,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 25c9b733e8..45e81ab67f 100644 --- a/src/util.h +++ b/src/util.h @@ -208,7 +208,6 @@ std::string HelpMessageOpt(const std::string& option, const std::string& message */ int GetNumCores(); -void SetThreadPriority(int nPriority); void RenameThread(const char* name); /** |