mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
Merge #8011: don't run ThreadMessageHandler at lowered priority
e53e7c5
don't run ThreadMessageHandler at lowered priority (Kaz Wesley)
This commit is contained in:
parent
d4b8abf4ff
commit
c66fcf47e0
11
src/compat.h
11
src/compat.h
@ -78,17 +78,6 @@ typedef u_int SOCKET;
|
|||||||
#define MSG_NOSIGNAL 0
|
#define MSG_NOSIGNAL 0
|
||||||
#endif
|
#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
|
#if HAVE_DECL_STRNLEN == 0
|
||||||
size_t strnlen( const char *start, size_t max_len);
|
size_t strnlen( const char *start, size_t max_len);
|
||||||
#endif // HAVE_DECL_STRNLEN
|
#endif // HAVE_DECL_STRNLEN
|
||||||
|
@ -1919,7 +1919,6 @@ bool CConnman::OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGran
|
|||||||
|
|
||||||
void CConnman::ThreadMessageHandler()
|
void CConnman::ThreadMessageHandler()
|
||||||
{
|
{
|
||||||
SetThreadPriority(THREAD_PRIORITY_BELOW_NORMAL);
|
|
||||||
while (!flagInterruptMsgProc)
|
while (!flagInterruptMsgProc)
|
||||||
{
|
{
|
||||||
std::vector<CNode*> vNodesCopy = CopyNodeVector();
|
std::vector<CNode*> vNodesCopy = CopyNodeVector();
|
||||||
|
13
src/util.cpp
13
src/util.cpp
@ -910,19 +910,6 @@ bool SetupNetworking()
|
|||||||
return true;
|
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()
|
int GetNumCores()
|
||||||
{
|
{
|
||||||
#if BOOST_VERSION >= 105600
|
#if BOOST_VERSION >= 105600
|
||||||
|
@ -231,7 +231,6 @@ std::string HelpMessageOpt(const std::string& option, const std::string& message
|
|||||||
*/
|
*/
|
||||||
int GetNumCores();
|
int GetNumCores();
|
||||||
|
|
||||||
void SetThreadPriority(int nPriority);
|
|
||||||
void RenameThread(const char* name);
|
void RenameThread(const char* name);
|
||||||
std::string GetThreadName();
|
std::string GetThreadName();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user