diff options
author | Aleksandar Donchev <Aleksander.Donchev@partner.bmw.de> | 2017-11-27 15:39:53 +0100 |
---|---|---|
committer | Jacqueline Molz <Jacqueline.Molz@bmw.de> | 2017-12-04 08:20:14 +0100 |
commit | 849e645ac9a88c7c49c8b876276c57e064442dd0 (patch) | |
tree | 7f92c2313db1a94227d5456829ed2e55ae039fd3 /AudioManagerDaemon | |
parent | b8f091112d49c6e2e4695a4e813e2f8a0ce20f6e (diff) | |
download | audiomanager-849e645ac9a88c7c49c8b876276c57e064442dd0.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')
-rwxr-xr-x | AudioManagerDaemon/src/main.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/AudioManagerDaemon/src/main.cpp b/AudioManagerDaemon/src/main.cpp index 22470e9..527206a 100755 --- a/AudioManagerDaemon/src/main.cpp +++ b/AudioManagerDaemon/src/main.cpp @@ -384,14 +384,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)); |