summaryrefslogtreecommitdiff
path: root/AudioManagerDaemon/src/main.cpp
diff options
context:
space:
mode:
authorAleksandar Donchev <Aleksander.Donchev@partner.bmw.de>2017-11-27 15:39:53 +0100
committerJacqueline Molz <Jacqueline.Molz@bmw.de>2018-02-13 12:48:36 +0100
commitd6481481d86408a5b1c74162012167ed57ac6ee9 (patch)
tree6713f2695103494b2b4fe445fb95f9fe2b629041 /AudioManagerDaemon/src/main.cpp
parent34207d94acb8914c4f45b64c2362c645251a53ec (diff)
downloadaudiomanager-d6481481d86408a5b1c74162012167ed57ac6ee9.tar.gz
Cmake parameters for real-time scheduler's priority and policy and throw runtime error if read fails.
Signed-off-by: Christian Linke <christian.linke@bmw.de> Change-Id: I6a7a2c424bc8fac62c76a66545a231c518edb2e1
Diffstat (limited to 'AudioManagerDaemon/src/main.cpp')
-rwxr-xr-xAudioManagerDaemon/src/main.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/AudioManagerDaemon/src/main.cpp b/AudioManagerDaemon/src/main.cpp
index 8838ceb..879687d 100755
--- a/AudioManagerDaemon/src/main.cpp
+++ b/AudioManagerDaemon/src/main.cpp
@@ -387,14 +387,11 @@ iControlSender.setControllerReady();
*/
int main(int argc, char *argv[], char** envp)
{
- struct sched_param param;
- param.sched_priority = 50;//mid rt proprity
- if (sched_setscheduler(0, SCHED_FIFO, & param) != 0)
- {
- std::cerr <<"sched_setscheduler:"<<strerror(errno)<<std::endl;
- std::cerr << "Try running as root"<<std::endl;
- }
-
+ //Set runtime-scheduler with priority and policy for all threads. You can define the priority and policy via cmake.
+ //If the cmake option WITH_REALTIME_SCHEDULER is OFF the following macro is empty.
+ //If a thread needs other settings you can use CAmSocketHandler::setRuntimeScheduler(...)
+ SET_REALTIME_SCHEDULER()
+
(void) envp;
listCommandPluginDirs.push_back(std::string(DEFAULT_PLUGIN_COMMAND_DIR));
listRoutingPluginDirs.push_back(std::string(DEFAULT_PLUGIN_ROUTING_DIR));