diff options
author | Christian Linke <Christian.Linke@bmw.de> | 2016-02-16 17:44:08 +0100 |
---|---|---|
committer | Christian Linke <Christian.Linke@bmw.de> | 2016-02-16 17:44:08 +0100 |
commit | c7ef1ef0126023ca8a377f00ae9aebb81bc34d37 (patch) | |
tree | fd04e68508d3ec32f2ec6eee98e8f2759d331e00 /AudioManagerUtilities/include | |
parent | 5bcd206b9270d9a79e212f91723ea1a08a4d4859 (diff) | |
download | audiomanager-c7ef1ef0126023ca8a377f00ae9aebb81bc34d37.tar.gz |
Added overflow handling for timer and poll handles
Signed-off-by: Christian Linke <Christian.Linke@bmw.de>
Diffstat (limited to 'AudioManagerUtilities/include')
-rw-r--r-- | AudioManagerUtilities/include/CAmSocketHandler.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/AudioManagerUtilities/include/CAmSocketHandler.h b/AudioManagerUtilities/include/CAmSocketHandler.h index 1a988c5..edf19fd 100644 --- a/AudioManagerUtilities/include/CAmSocketHandler.h +++ b/AudioManagerUtilities/include/CAmSocketHandler.h @@ -23,6 +23,7 @@ #include <sys/poll.h> #include <list> #include <map> +#include <set> #include <signal.h> #include <iostream> //todo: remove me @@ -30,6 +31,8 @@ namespace am { #define MAX_NS 1000000000L +#define MAX_TIMERHANDLE INT16_MAX +#define MAX_POLLHANDLE INT16_MAX typedef uint16_t sh_timerHandle_t; //!<this is a handle for a timer to be used with the SocketHandler typedef uint16_t sh_pollHandle_t; //!<this is a handle for a filedescriptor to be used with the SocketHandler @@ -178,7 +181,7 @@ private: int mDispatchDone; //this starts / stops the mainloop struct sh_timer_s //!<struct that holds information of timers { - sh_timerHandle_t handle; //!<the handle of the timer + sh_timerHandle_t handle; //!<the handle of the timer timespec countdown; //!<the countdown, this value is decreased every time the timer is up IAmShTimerCallBack* callback; //!<the callbackfunction void * userData; //!<saves a void pointer together with the rest. @@ -433,7 +436,9 @@ private: }; mListPollfd_t mfdPollingArray; //!<the polling array for ppoll + std::set<sh_pollHandle_t> mSetPollKeys; //!A set of all used ppoll keys mListPoll_t mListPoll; //!<list that holds all information for the ppoll + std::set<sh_timerHandle_t> mSetTimerKeys; //!A set of all used timer keys std::list<sh_timer_s> mListTimer; //!<list of all timers std::list<sh_timer_s> mListActiveTimer; //!<list of all currently active timers sh_timerHandle_t mLastInsertedHandle; //!<keeps track of the last inserted timer handle |