diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-08-20 17:43:56 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-08-26 13:25:21 +0200 |
commit | 610a8c075958aa95b97f62a7ab020a543694c23d (patch) | |
tree | 8639401fd1aeeac4314c44552d4473c1f8652109 /src/util.cpp | |
parent | f780e65ac632d2cad51d00c2b4a93248a5df91a6 (diff) |
Move SetThreadPriority implementation to util.cpp instead of the header
Put the THREAD_* and PRIO_ constants in compat.h.
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/util.cpp b/src/util.cpp index ae2145a3a0..606f5a60f9 100644 --- a/src/util.cpp +++ b/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 +} |