summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client/RdmaConnector.cpp
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2010-06-14 14:50:16 +0000
committerAndrew Stitcher <astitcher@apache.org>2010-06-14 14:50:16 +0000
commit76013c074339252267579e6f17dd2db4894715cd (patch)
tree674cf7a55a0672a972007659be0a93bc70dd1810 /cpp/src/qpid/client/RdmaConnector.cpp
parent74572dd5127e644093f2820e59a2b27df1720618 (diff)
downloadqpid-python-76013c074339252267579e6f17dd2db4894715cd.tar.gz
In Rdma::AsynchIO::stop():
- make sure we stop the underlying handle immediately whether or not we do the stopped callback now or have to defer it. In qpid::client::RdmaConnector: - make sure that the shutdown handler is called under all circumstances. - make sure that the destructor doesn't delete the aio if it is already deleted git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@954492 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/RdmaConnector.cpp')
-rw-r--r--cpp/src/qpid/client/RdmaConnector.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/cpp/src/qpid/client/RdmaConnector.cpp b/cpp/src/qpid/client/RdmaConnector.cpp
index 9be9e7127c..624f457d8d 100644
--- a/cpp/src/qpid/client/RdmaConnector.cpp
+++ b/cpp/src/qpid/client/RdmaConnector.cpp
@@ -162,7 +162,12 @@ namespace {
RdmaConnector::~RdmaConnector() {
QPID_LOG(debug, "~RdmaConnector " << identifier);
close();
- if (aio) aio->stop(deleteAsynchIO);
+ if (aio) {
+ aio->stop(deleteAsynchIO);
+ }
+ if (shutdownHandler) {
+ shutdownHandler->shutdown();
+ }
}
void RdmaConnector::connect(const std::string& host, int port){
@@ -244,15 +249,21 @@ void RdmaConnector::dataError(Rdma::AsynchIO&) {
drained();
}
-void RdmaConnector::stopped(Rdma::AsynchIO* aio) {
- delete aio;
+void RdmaConnector::stopped(Rdma::AsynchIO* a) {
+ QPID_LOG(debug, "RdmaConnector::stopped " << identifier);
+ assert(!polling);
+ aio = 0;
+ delete a;
if (shutdownHandler) {
- shutdownHandler->shutdown();
+ ShutdownHandler* s = shutdownHandler;
+ shutdownHandler = 0;
+ s->shutdown();
}
}
void RdmaConnector::drained() {
QPID_LOG(debug, "RdmaConnector::drained " << identifier);
+ assert(!polling);
if (aio) {
aio->stop(boost::bind(&RdmaConnector::stopped, this, aio));
aio = 0;