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 | 6185e64390a97b5b066435f14febd46421d77ccd (patch) | |
| tree | 5e0ad0b7ff82c50f09dcf3604a9d95852e4af950 /cpp/src | |
| parent | c792514150bfe936513b42da3e85f708eb89ffad (diff) | |
| download | qpid-python-6185e64390a97b5b066435f14febd46421d77ccd.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; } |
