summaryrefslogtreecommitdiff
path: root/AudioManagerUtilities/include/CAmSocketHandler.h
diff options
context:
space:
mode:
authorAleksandar Donchev <Aleksander.Donchev@partner.bmw.de>2017-09-25 17:01:18 +0200
committerAleksandar Donchev <Aleksander.Donchev@partner.bmw.de>2017-09-26 11:47:44 +0200
commite94f414079757ecb946f36fa0caf55524a75d5e7 (patch)
tree84a3f98c1bf9606d37482d4e7c6d3a30361cf0a4 /AudioManagerUtilities/include/CAmSocketHandler.h
parent060323be5e5456b57229555d684680bf5d815052 (diff)
downloadaudiomanager-e94f414079757ecb946f36fa0caf55524a75d5e7.tar.gz
Timer fd is closed at the beginning of the next iteration + some unit tests.
Signed-off-by: Christian Linke <christian.linke@bmw.de> Change-Id: I8c5d3c436ac9fad62c76a26145c731b538abb1e7
Diffstat (limited to 'AudioManagerUtilities/include/CAmSocketHandler.h')
-rw-r--r--AudioManagerUtilities/include/CAmSocketHandler.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/AudioManagerUtilities/include/CAmSocketHandler.h b/AudioManagerUtilities/include/CAmSocketHandler.h
index 717f792..7baa496 100644
--- a/AudioManagerUtilities/include/CAmSocketHandler.h
+++ b/AudioManagerUtilities/include/CAmSocketHandler.h
@@ -244,10 +244,11 @@ class CAmSocketHandler
sh_timer_s() :
handle(0)
#ifdef WITH_TIMERFD
- , fd(0)
+ , fd(-1)
#endif
, countdown(), callback(), userData(0)
{}
+
};
struct sh_signal_s
@@ -291,7 +292,11 @@ class CAmSocketHandler
VectorListPoll_t mListPoll; //!<list that holds all information for the ppoll
sh_identifier_s mSetTimerKeys; //!A set of all used timer keys
std::list<sh_timer_s> mListTimer; //!<list of all timers
+#ifndef WITH_TIMERFD
std::list<sh_timer_s> mListActiveTimer; //!<list of all currently active timers
+#else
+ std::list<sh_timer_s> mListRemovedTimers;
+#endif
sh_identifier_s mSetSignalhandlerKeys; //!A set of all used signal handler keys
VectorSignalHandlers_t mSignalHandlers;
bool mRecreatePollfds; //!<when this is true, the poll list needs to be recreated
@@ -306,7 +311,7 @@ private:
timespec* insertTime(timespec& buffertime);
#ifdef WITH_TIMERFD
am_Error_e createTimeFD(const itimerspec & timeouts, int & fd);
-
+ void closeRemovedTimers();
#else
void timerUp();
void timerCorrection();
@@ -446,7 +451,7 @@ private:
bool nextHandle(sh_identifier_s & handle);
am_Error_e getFDPollData(const sh_pollHandle_t handle, sh_poll_s & outPollData);
-
+
public:
CAmSocketHandler();