diff options
author | Andrew Stitcher <astitcher@apache.org> | 2010-09-08 16:49:22 +0000 |
---|---|---|
committer | Andrew Stitcher <astitcher@apache.org> | 2010-09-08 16:49:22 +0000 |
commit | 97b75790dfa2e7ec95927159c89914879970bc46 (patch) | |
tree | 5e0ad0b7ff82c50f09dcf3604a9d95852e4af950 /cpp/src | |
parent | 82b6ba81103baac0f56b402645352c0c9f948680 (diff) | |
download | qpid-python-97b75790dfa2e7ec95927159c89914879970bc46.tar.gz |
Rearrange drain queue code so that it does't call the callback unless there
are no outstanding write buffers
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@995137 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/sys/rdma/RdmaIO.cpp | 11 |
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; } |