diff options
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/src/util.h b/src/util.h index 785d4056e7..939e59c301 100644 --- a/src/util.h +++ b/src/util.h @@ -342,34 +342,7 @@ bool TimingResistantEqual(const T& a, const T& b) return accumulator == 0; } -#ifdef WIN32 -inline void SetThreadPriority(int nPriority) -{ - SetThreadPriority(GetCurrentThread(), nPriority); -} -#else - -// 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) - -inline void SetThreadPriority(int nPriority) -{ - // It's unclear if it's even possible to change thread priorities on Linux, - // but we really and truly need it for the generation threads. -#ifdef PRIO_THREAD - setpriority(PRIO_THREAD, 0, nPriority); -#else - setpriority(PRIO_PROCESS, 0, nPriority); -#endif -} -#endif - +void SetThreadPriority(int nPriority); void RenameThread(const char* name); // Standard wrapper for do-something-forever thread functions. |