summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/sys/rdma/RdmaIO.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/cpp/src/qpid/sys/rdma/RdmaIO.cpp b/cpp/src/qpid/sys/rdma/RdmaIO.cpp
index f0ae7e5d77..3e0f1c1dad 100644
--- a/cpp/src/qpid/sys/rdma/RdmaIO.cpp
+++ b/cpp/src/qpid/sys/rdma/RdmaIO.cpp
@@ -123,15 +123,20 @@ namespace Rdma {
do {
newState = oldState = state.get();
doReturn = true;
- if (oldState == IDLE) {
- doReturn = false;
+ switch (oldState) {
+ case IDLE:
if (outstandingWrites == 0) {
+ doReturn = false;
newState = DRAINED;
+ break;
}
+ /*FALLTHRU*/
+ default:
+ draining = true;
+ break;
}
} while (!state.boolCompareAndSwap(oldState, newState));
if (doReturn) {
- draining = true;
notifyCallback = nc;
return;
}