aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--alc/helpers.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/alc/helpers.cpp b/alc/helpers.cpp
index ef6973cf..aa9ca7ae 100644
--- a/alc/helpers.cpp
+++ b/alc/helpers.cpp
@@ -463,8 +463,13 @@ void SetRTPriority()
* should be 1 for SCHED_RR).
*/
param.sched_priority = sched_get_priority_min(SCHED_RR);
- if(pthread_setschedparam(pthread_self(), SCHED_RR, &param))
- ERR("Failed to set priority level for thread\n");
+#ifdef SCHED_RESET_ON_FORK
+ if(pthread_setschedparam(pthread_self(), SCHED_RR|SCHED_RESET_ON_FORK, &param))
+#endif
+ {
+ if(pthread_setschedparam(pthread_self(), SCHED_RR, &param))
+ ERR("Failed to set real-time priority for thread\n");
+ }
}
#else
/* Real-time priority not available */