summaryrefslogtreecommitdiff
path: root/AudioManagerUtilities/include/CAmSocketHandler.h
diff options
context:
space:
mode:
authorAleksandar Donchev <Aleksander.Donchev@partner.bmw.de>2017-09-26 16:07:00 +0200
committerJacqueline Molz <Jacqueline.Molz@bmw.de>2018-02-13 12:48:31 +0100
commitbc33226f59910a960f62d419ba10d4ea761e3724 (patch)
treeb0a83ba9932944b3b3198c3ea8491aaab23d0c47 /AudioManagerUtilities/include/CAmSocketHandler.h
parentcfe0e77aaf87a0590ceea42f6afa62b0c7d95e80 (diff)
downloadaudiomanager-bc33226f59910a960f62d419ba10d4ea761e3724.tar.gz
A filedescriptor removal will set an invalidation flag which will prevent calls on the invalidated objects in the current iteration.
Signed-off-by: Christian Linke <christian.linke@bmw.de> Change-Id: I9d5d3c434ac9fad62c76a76145c731b538aeb1e3 # Conflicts: # AudioManagerUtilities/src/CAmSocketHandler.cpp
Diffstat (limited to 'AudioManagerUtilities/include/CAmSocketHandler.h')
-rw-r--r--AudioManagerUtilities/include/CAmSocketHandler.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/AudioManagerUtilities/include/CAmSocketHandler.h b/AudioManagerUtilities/include/CAmSocketHandler.h
index 7baa496..d14c1a3 100644
--- a/AudioManagerUtilities/include/CAmSocketHandler.h
+++ b/AudioManagerUtilities/include/CAmSocketHandler.h
@@ -217,6 +217,7 @@ class CAmSocketHandler
{
struct sh_poll_s //!<struct that holds information about polls
{
+ bool isValid;
sh_pollHandle_t handle; //!<handle to uniquely adress a filedesriptor
pollfd pollfdValue; //!<the array for polling the filedescriptors
std::function<void(const sh_pollHandle_t handle, void* userData)> prepareCB; //preperation callback
@@ -226,7 +227,7 @@ class CAmSocketHandler
void* userData;
sh_poll_s() :
- handle(0), pollfdValue(), prepareCB(), firedCB(), checkCB(), dispatchCB(), userData(0)
+ isValid(true), handle(0), pollfdValue(), prepareCB(), firedCB(), checkCB(), dispatchCB(), userData(0)
{}
};
@@ -302,9 +303,11 @@ class CAmSocketHandler
bool mRecreatePollfds; //!<when this is true, the poll list needs to be recreated
internal_codes_t mInternalCodes;
sh_pollHandle_t mSignalFdHandle;
+ VectorListPoll_t mListActivePolls;
#ifndef WITH_TIMERFD
timespec mStartTime; //!<here the actual time is saved for timecorrection
#endif
+
private:
bool fdIsValid(const int fd) const;
@@ -413,7 +416,7 @@ private:
* @param a
* @return
*/
- inline static void fire(sh_poll_s& a);
+ inline static void fire(const sh_poll_s* a);
/**
* functor to return all fired events
@@ -427,14 +430,14 @@ private:
* @param a
* @return
*/
- inline static bool noDispatching(const sh_poll_s& a);
+ inline static bool noDispatching(const sh_poll_s* a);
/**
* checks if dispatching is already finished
* @param a
* @return
*/
- inline static bool dispatchingFinished(const sh_poll_s& a);
+ inline static bool dispatchingFinished(const sh_poll_s* a);
/**
* timer fire callback