diff options
Diffstat (limited to 'cpp/src/qpid/sys/Dispatcher.h')
| -rw-r--r-- | cpp/src/qpid/sys/Dispatcher.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/cpp/src/qpid/sys/Dispatcher.h b/cpp/src/qpid/sys/Dispatcher.h index 2de026e141..0cfaf8b5d4 100644 --- a/cpp/src/qpid/sys/Dispatcher.h +++ b/cpp/src/qpid/sys/Dispatcher.h @@ -27,6 +27,7 @@ #include "Mutex.h" #include <memory> +#include <queue> #include <boost/function.hpp> #include <assert.h> @@ -53,13 +54,33 @@ private: DELAYED_DELETE } state; + /** + * TODO: The following are part of a temporary fix to ensure that + * where a new event is generated for the same handle while an + * earlier one is still being processed (due to an interest in + * writeability being declared) the events are processed serially + * by the first thread. + */ + Mutex processLock; + bool processing; + bool deleted; + std::queue<Poller::EventType> events; + + bool start(Poller::EventType type); + void handle(Poller::EventType type); + void drain(); + bool next(Poller::EventType& type); + /**************************************************************/ + public: DispatchHandle(const Socket& s, Callback rCb, Callback wCb, Callback dCb) : PollerHandle(s), readableCallback(rCb), writableCallback(wCb), disconnectedCallback(dCb), - state(IDLE) + state(IDLE), + processing(false), + deleted(false) {} ~DispatchHandle(); |
