summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2009-03-02 18:42:02 +0000
committerAndrew Stitcher <astitcher@apache.org>2009-03-02 18:42:02 +0000
commitecd668842148df98b9e5bbea8fbc88a5f363d42b (patch)
treed818ee678418a18e94bf8ab25dc23ab907586d00 /cpp/src/qpid/client
parent3578e8a032e35da6979edf48520a3b08a06f2e04 (diff)
downloadqpid-python-ecd668842148df98b9e5bbea8fbc88a5f363d42b.tar.gz
- Reworked DispatchHandler state machine to eliminate race conditions
particularly when deleting a DispatchHandle - Reworked Poller interrupt mechanism eliminating locking problems and to support DispatchHandler changes - Beefed up the DispatchHandler test program so that it's a fair torture test of the DispatchHandler code git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@749406 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client')
-rw-r--r--cpp/src/qpid/client/Connector.cpp6
-rw-r--r--cpp/src/qpid/client/SslConnector.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/cpp/src/qpid/client/Connector.cpp b/cpp/src/qpid/client/Connector.cpp
index e6355601df..1d1e39cd10 100644
--- a/cpp/src/qpid/client/Connector.cpp
+++ b/cpp/src/qpid/client/Connector.cpp
@@ -220,6 +220,7 @@ bool TCPConnector::closeInternal() {
bool ret = !closed;
if (!closed) {
closed = true;
+ aio->queueForDeletion();
poller->shutdown();
}
if (!joined && receiver.id() != Thread::current().id()) {
@@ -384,14 +385,13 @@ void TCPConnector::run() {
assert(protect);
try {
Dispatcher d(poller);
-
+
for (int i = 0; i < 32; i++) {
aio->queueReadBuffer(new Buff(maxFrameSize));
}
-
+
aio->start(poller);
d.run();
- aio->queueForDeletion();
socket.close();
} catch (const std::exception& e) {
QPID_LOG(error, QPID_MSG("FAIL " << identifier << ": " << e.what()));
diff --git a/cpp/src/qpid/client/SslConnector.cpp b/cpp/src/qpid/client/SslConnector.cpp
index 75c3f5677e..a4298dd4ca 100644
--- a/cpp/src/qpid/client/SslConnector.cpp
+++ b/cpp/src/qpid/client/SslConnector.cpp
@@ -221,6 +221,7 @@ bool SslConnector::closeInternal() {
bool ret = !closed;
if (!closed) {
closed = true;
+ aio->queueForDeletion();
poller->shutdown();
}
if (!joined && receiver.id() != Thread::current().id()) {
@@ -386,7 +387,6 @@ void SslConnector::run(){
aio->start(poller);
d.run();
- aio->queueForDeletion();
socket.close();
} catch (const std::exception& e) {
QPID_LOG(error, e.what());