aboutsummaryrefslogtreecommitdiffstats
path: root/src/Main.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-30 18:37:30 +0100
committerMax Kellermann <max@duempel.org>2014-01-30 18:43:40 +0100
commita31738f6f1473f4f621bc16513ed0c6024749389 (patch)
tree9a97fe23e91de211a545173f3d90bebef1b043c5 /src/Main.cxx
parent39a2867ea806682922a5bc8b0057bd4ddcbb4dcb (diff)
downloadmpd-a31738f6f1473f4f621bc16513ed0c6024749389.tar.gz
mpd-a31738f6f1473f4f621bc16513ed0c6024749389.tar.xz
mpd-a31738f6f1473f4f621bc16513ed0c6024749389.zip
Main, OutputThread: increase kernel timer slack (Linux)
Allows the kernel to combine timer wakeups with other processes, reducing power usage.
Diffstat (limited to '')
-rw-r--r--src/Main.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Main.cxx b/src/Main.cxx
index f8f7a6545..ab70c875c 100644
--- a/src/Main.cxx
+++ b/src/Main.cxx
@@ -60,6 +60,7 @@
#include "util/Error.hxx"
#include "util/Domain.hxx"
#include "thread/Id.hxx"
+#include "thread/Slack.hxx"
#include "config/ConfigGlobal.hxx"
#include "config/ConfigData.hxx"
#include "config/ConfigDefaults.hxx"
@@ -523,6 +524,10 @@ int mpd_main(int argc, char *argv[])
win32_app_started();
#endif
+ /* the MPD frontend does not care about timer slack; set it to
+ a huge value to allow the kernel to reduce CPU wakeups */
+ SetThreadTimerSlackMS(100);
+
/* run the main loop */
main_loop->Run();