summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/sys/DispatchHandle.h
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2009-05-04 15:55:21 +0000
committerAndrew Stitcher <astitcher@apache.org>2009-05-04 15:55:21 +0000
commit564d179640cf49feeb8ff84133f892499afb0e65 (patch)
treed6fb4c2f2c789379937c2b622772cea2aed69e1d /cpp/src/qpid/sys/DispatchHandle.h
parentc912884c11debf57e8c154fba7dbbcae8ea34d90 (diff)
downloadqpid-python-564d179640cf49feeb8ff84133f892499afb0e65.tar.gz
Refactored the DispatchHandle/Poller code to remove a long standing
set of race conditions. - Changed Poller naming for better clarity with new semantics. - Changed Poller semantics to avoid DispatchHandle keeping so much state - Changed Poller so that it will never re-enable a Handle until Poller::wait is called again on the same thread that returned the Handle. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@771338 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys/DispatchHandle.h')
-rw-r--r--cpp/src/qpid/sys/DispatchHandle.h19
1 files changed, 6 insertions, 13 deletions
diff --git a/cpp/src/qpid/sys/DispatchHandle.h b/cpp/src/qpid/sys/DispatchHandle.h
index bc9f98775e..916d4c641a 100644
--- a/cpp/src/qpid/sys/DispatchHandle.h
+++ b/cpp/src/qpid/sys/DispatchHandle.h
@@ -64,10 +64,11 @@ private:
Poller::shared_ptr poller;
Mutex stateLock;
enum {
- IDLE, INACTIVE, ACTIVE_R, ACTIVE_W, ACTIVE_RW,
- ACTIVE_DELETE,
- DELAYED_IDLE, DELAYED_INACTIVE, DELAYED_R, DELAYED_W, DELAYED_RW,
- DELAYED_DELETE
+ IDLE,
+ STOPPING,
+ WAITING,
+ CALLING,
+ DELETING
} state;
public:
@@ -83,14 +84,7 @@ public:
*@param wCb Callback called when the handle is writable.
*@param dCb Callback called when the handle is disconnected.
*/
- QPID_COMMON_EXTERN DispatchHandle(const IOHandle& h, Callback rCb, Callback wCb, Callback dCb) :
- PollerHandle(h),
- readableCallback(rCb),
- writableCallback(wCb),
- disconnectedCallback(dCb),
- state(IDLE)
- {}
-
+ QPID_COMMON_EXTERN DispatchHandle(const IOHandle& h, Callback rCb, Callback wCb, Callback dCb);
QPID_COMMON_EXTERN ~DispatchHandle();
/** Add this DispatchHandle to the poller to be watched. */
@@ -122,7 +116,6 @@ public:
QPID_COMMON_EXTERN void call(Callback iCb);
protected:
- /** Override to get extra processing done when the DispatchHandle is deleted. */
QPID_COMMON_EXTERN void doDelete();
private: