aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-08-31 01:05:01 -0700
committerChris Robinson <[email protected]>2011-08-31 01:05:01 -0700
commitf3ac3cd1e23f0330396da242303f318c8a4b0fbb (patch)
tree3591b08427ad6d11b0543ffdc47f2f4fdbc31a1c
parentdd747573191938c9721945ac455d325d39d64fd2 (diff)
Don't set a thread priority if real-time isn't requested
-rw-r--r--Alc/helpers.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/Alc/helpers.c b/Alc/helpers.c
index f6c05a47..fab8209a 100644
--- a/Alc/helpers.c
+++ b/Alc/helpers.c
@@ -235,28 +235,20 @@ void al_print(const char *fname, unsigned int line, const char *fmt, ...)
void SetRTPriority(void)
{
- ALboolean failed;
+ ALboolean failed = AL_FALSE;
#ifdef _WIN32
if(RTPrioLevel > 0)
failed = !SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
- else
- failed = !SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL);
#elif defined(HAVE_PTHREAD_SETSCHEDPARAM) && !defined(__OpenBSD__)
- struct sched_param param;
-
if(RTPrioLevel > 0)
{
+ struct sched_param param;
/* Use the minimum real-time priority possible for now (on Linux this
* should be 1 for SCHED_RR) */
param.sched_priority = sched_get_priority_min(SCHED_RR);
failed = !!pthread_setschedparam(pthread_self(), SCHED_RR, &param);
}
- else
- {
- param.sched_priority = 0;
- failed = !!pthread_setschedparam(pthread_self(), SCHED_OTHER, &param);
- }
#else
/* Real-time priority not available */
failed = (RTPrioLevel>0);