diff options
Diffstat (limited to 'Alc/helpers.cpp')
-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) { |