summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2010-09-08 16:49:41 +0000
committerAndrew Stitcher <astitcher@apache.org>2010-09-08 16:49:41 +0000
commit8c27a5bad52f198b082821920ab328550c8291fa (patch)
tree4c68ff7ce098e720227e4aad8c415e7b2221b094 /qpid/cpp/src
parentb88ab12ab40b70b4eb7449fd6b9bcf41408a54b6 (diff)
downloadqpid-python-8c27a5bad52f198b082821920ab328550c8291fa.tar.gz
Avoid Rdma::AsynchIO leaking when stopped without being drained and
add in asserts to be sure that you call stopped and drained callbacks in the correct state git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@995142 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp b/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp
index 3e0f1c1dad..068e8cf187 100644
--- a/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp
+++ b/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp
@@ -452,7 +452,7 @@ namespace Rdma {
}
// We might need to delete ourselves
- if (notifyCallback && outstandingWrites == 0) {
+ if (notifyCallback) {
doStoppedCallback();
}
}
@@ -464,6 +464,7 @@ namespace Rdma {
State oldState;
do {
oldState = state.get();
+ assert(oldState==IDLE);
} while (!state.boolCompareAndSwap(oldState, DRAINED));
nc(*this);
}
@@ -475,6 +476,7 @@ namespace Rdma {
State oldState;
do {
oldState = state.get();
+ assert(oldState==IDLE);
} while (!state.boolCompareAndSwap(oldState, SHUTDOWN));
nc(*this);
}