summaryrefslogtreecommitdiff
path: root/AudioManagerUtilities
diff options
context:
space:
mode:
Diffstat (limited to 'AudioManagerUtilities')
-rw-r--r--AudioManagerUtilities/include/CAmSocketHandler.h22
-rw-r--r--AudioManagerUtilities/src/CAmDltWrapper.cpp5
-rw-r--r--AudioManagerUtilities/src/CAmSocketHandler.cpp13
-rw-r--r--AudioManagerUtilities/test/AmSocketHandlerTest/CAmSocketHandlerTest.cpp5
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();
}