diff options
author | Chris Robinson <[email protected]> | 2018-11-12 18:05:16 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-12 18:05:16 -0800 |
commit | c0f2858f3d47323205bb90b3b1cc7db2553e6917 (patch) | |
tree | bc2fba91d42299e39f506b7d9c050702b5add7a9 | |
parent | 4def2a60f20cff8e9cc7b9b78e09008ef06041ce (diff) |
Split Windows-specific SetRTPriority
-rw-r--r-- | Alc/helpers.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/Alc/helpers.cpp b/Alc/helpers.cpp index cb479f4b..833be68e 100644 --- a/Alc/helpers.cpp +++ b/Alc/helpers.cpp @@ -466,6 +466,14 @@ std::vector<std::string> SearchDataFiles(const char *ext, const char *subdir) return results; } +void SetRTPriority(void) +{ + bool failed = false; + if(RTPrioLevel > 0) + failed = !SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL); + if(failed) ERR("Failed to set priority level for thread\n"); +} + #else PathNamePair GetProcBinary() @@ -700,17 +708,10 @@ std::vector<std::string> SearchDataFiles(const char *ext, const char *subdir) return results; } -#endif - - void SetRTPriority(void) { - ALboolean failed = AL_FALSE; - -#ifdef _WIN32 - if(RTPrioLevel > 0) - failed = !SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL); -#elif defined(HAVE_PTHREAD_SETSCHEDPARAM) && !defined(__OpenBSD__) + bool failed = false; +#if defined(HAVE_PTHREAD_SETSCHEDPARAM) && !defined(__OpenBSD__) if(RTPrioLevel > 0) { struct sched_param param; @@ -727,6 +728,8 @@ void SetRTPriority(void) ERR("Failed to set priority level for thread\n"); } +#endif + void alstr_clear(al_string *str) { |