Bring back SetThreadPriority

This commit is contained in:
lateminer
2018-10-22 00:22:54 +03:00
parent fad48f416c
commit a28600154a
3 changed files with 25 additions and 24 deletions

View File

@@ -789,6 +789,19 @@ 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