mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-08 03:33:32 +01:00
Move SetThreadPriority implementation to util.cpp instead of the header
Put the THREAD_* and PRIO_ constants in compat.h.
This commit is contained in:
13
src/util.cpp
13
src/util.cpp
@@ -1286,3 +1286,16 @@ std::string FormatParagraph(const std::string in, size_t width, size_t indent)
|
||||
}
|
||||
return out.str();
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user