summaryrefslogtreecommitdiff
path: root/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
commitfe43eb372cfe6a2812f46b5d19e853b3724ac3a1 (patch)
tree6f280d8267c44915772eb1ca7a054c70d0ad20fd /cpp/src
parent7e0e181772e31e13024c5dea4c1094ffd155c002 (diff)
downloadqpid-python-fe43eb372cfe6a2812f46b5d19e853b3724ac3a1.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/qpid@995142 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/sys/rdma/RdmaIO.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/cpp/src/qpid/sys/rdma/RdmaIO.cpp b/cpp/src/qpid/sys/rdma/RdmaIO.cpp
index 3e0f1c1dad..068e8cf187 100644
--- a/cpp/src/qpid/sys/rdma/RdmaIO.cpp
+++ b/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);
}