Move SetThreadPriority implementation to util.cpp instead of the header

Put the THREAD_* and PRIO_ constants in compat.h.
This commit is contained in:
Wladimir J. van der Laan
2014-08-20 17:43:56 +02:00
parent f780e65ac6
commit 610a8c0759
3 changed files with 25 additions and 28 deletions

View File

@@ -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
}