Emit a warning if the OutputThread fails to get realtime scheduling

This only applies to linux systems.  Here, sched_setscheduler() is
called to get realtime scheduling.  With this patch, the return value
of this function is now checked and a warning / error message is
generated if it fails.
This commit is contained in:
Christian Halaszovich
2015-06-23 17:16:46 +02:00
committed by Max Kellermann
parent e7b211f2c0
commit 3392cbbd91
2 changed files with 21 additions and 5 deletions

View File

@@ -593,7 +593,12 @@ AudioOutput::Task()
{
FormatThreadName("output:%s", name);
SetThreadRealtime();
Error error;
if(!SetThreadRealtime(error)) {
LogError(error);
LogWarning(output_domain,
"OutputThread could not get realtime scheduling, continuing anyway");
}
SetThreadTimerSlackUS(100);
mutex.lock();