diff options
author | Aleksandar Donchev <aleksander.donchev@partner.bmw.de> | 2018-02-07 10:51:17 +0100 |
---|---|---|
committer | Jacqueline Molz <Jacqueline.Molz@bmw.de> | 2018-02-13 12:54:59 +0100 |
commit | b6753f2666811af437c8711dd06509e4c7ca3f33 (patch) | |
tree | 9f4032a508e717cb55e2cf38912e1d46565e53d8 /AudioManagerUtilities | |
parent | d6481481d86408a5b1c74162012167ed57ac6ee9 (diff) | |
download | audiomanager-b6753f2666811af437c8711dd06509e4c7ca3f33.tar.gz |
The real-time scheduler removed.
Signed-off-by: Christian Linke <christian.linke@bmw.de>
Change-Id: I7c8a2c474bc8fac62c76a46545a231c518edb2a8
Diffstat (limited to 'AudioManagerUtilities')
4 files changed, 3 insertions, 42 deletions
diff --git a/AudioManagerUtilities/include/CAmSocketHandler.h b/AudioManagerUtilities/include/CAmSocketHandler.h index 2fd5c42..53010ba 100644 --- a/AudioManagerUtilities/include/CAmSocketHandler.h +++ b/AudioManagerUtilities/include/CAmSocketHandler.h @@ -492,29 +492,7 @@ public: void exit_mainloop(); bool fatalErrorOccurred(); -#ifdef WITH_REALTIME_SCHEDULER - /** - * Set scheduling algorithm and/or parameters for a thread whose ID is specified in pid. - * If pid equals zero, the scheduling policy and parameters of the calling thread will be set. - * @param pid_t pid thread id - * @param int policy equals specified policies in sched_setscheduler documentation - * @param int priority between 1 and 99 - * @return on success 0 and on error -1 - */ - static int setRuntimeScheduler(const pid_t pid, const int policy, const int priority); -#endif }; -#ifdef WITH_REALTIME_SCHEDULER -#define SET_REALTIME_SCHEDULER()\ - if ( CAmSocketHandler::setRuntimeScheduler(0, AM_REALTIME_POLICY, AM_PROCESS_PRIORITY) != 0 )\ - {\ - std::cerr <<"sched_setscheduler:"<<strerror(errno)<<std::endl;\ - std::cerr << "Try running as root"<<std::endl;\ - } -#else -#define SET_REALTIME_SCHEDULER() -#endif - } /* namespace am */ #endif /* SOCKETHANDLER_H_ */ diff --git a/AudioManagerUtilities/src/CAmDltWrapper.cpp b/AudioManagerUtilities/src/CAmDltWrapper.cpp index 742b396..44ec614 100644 --- a/AudioManagerUtilities/src/CAmDltWrapper.cpp +++ b/AudioManagerUtilities/src/CAmDltWrapper.cpp @@ -23,13 +23,14 @@ */ -#include "CAmDltWrapper.h" #include <string> #include <iostream> #include <string.h> #include <chrono> #include <ctime> +#include <sys/types.h> #include <unistd.h> +#include "CAmDltWrapper.h" namespace am { @@ -625,7 +626,7 @@ bool CAmDltWrapper::initNoDlt(DltLogLevelType loglevel, DltContext* context) bool CAmDltWrapper::init(DltLogLevelType loglevel, DltContext* context) { pthread_mutex_lock(&mMutex); - initNoDlt(loglevel,context); + return initNoDlt(loglevel,context); } void CAmDltWrapper::send() diff --git a/AudioManagerUtilities/src/CAmSocketHandler.cpp b/AudioManagerUtilities/src/CAmSocketHandler.cpp index ef5d09a..4c46dd1 100644 --- a/AudioManagerUtilities/src/CAmSocketHandler.cpp +++ b/AudioManagerUtilities/src/CAmSocketHandler.cpp @@ -249,19 +249,6 @@ bool CAmSocketHandler::fatalErrorOccurred() return ((mInternalCodes&internal_codes_e::PIPE_ERROR)>0)||((mInternalCodes&internal_codes_e::FD_ERROR)>0); } -#ifdef WITH_REALTIME_SCHEDULER -int CAmSocketHandler::setRuntimeScheduler(const pid_t pid, const int policy, const int priority) -{ - //The following structure is used to set a processes priority - struct sched_param param; - //Set the priority of the process - param.sched_priority = priority; - - int ret = sched_setscheduler(pid, policy, & param); - return ret; -} -#endif - am_Error_e CAmSocketHandler::getFDPollData(const sh_pollHandle_t handle, sh_poll_s & outPollData) { VectorListPoll_t::iterator iterator = mListPoll.begin(); diff --git a/AudioManagerUtilities/test/AmSocketHandlerTest/CAmSocketHandlerTest.cpp b/AudioManagerUtilities/test/AmSocketHandlerTest/CAmSocketHandlerTest.cpp index c4af4c1..3908c2e 100644 --- a/AudioManagerUtilities/test/AmSocketHandlerTest/CAmSocketHandlerTest.cpp +++ b/AudioManagerUtilities/test/AmSocketHandlerTest/CAmSocketHandlerTest.cpp @@ -761,11 +761,6 @@ TEST(CAmSocketHandlerTest,playWithSockets) int main(int argc, char **argv) { - //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() - ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } |