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
committerJacqueline Molz <Jacqueline.Molz@bmw.de>2018-02-13 12:47:47 +0100
commitcfe0e77aaf87a0590ceea42f6afa62b0c7d95e80 (patch)
treeb6b83b5bd2b2f2bb98303e52a186d55b0d5af0cb /AudioManagerUtilities/include/CAmSocketHandler.h
parentbcaeed20bbbb4375ae925d507821d2bef64e737b (diff)
downloadaudiomanager-cfe0e77aaf87a0590ceea42f6afa62b0c7d95e80.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();