summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2010-09-08 16:49:14 +0000
committerAndrew Stitcher <astitcher@apache.org>2010-09-08 16:49:14 +0000
commit7a843fa13909d54281639bd1b7d2348b853287be (patch)
treeb746f9b5cf2eb05d6bce670d2e5bc28af2dc5e4b /cpp
parentd9e8137e9cc81506a1ee458f4fe73102cc1a4eaf (diff)
downloadqpid-python-7a843fa13909d54281639bd1b7d2348b853287be.tar.gz
Reorder some code for improved intellegibility
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@995135 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/qpid/sys/rdma/RdmaIO.cpp25
1 files changed, 10 insertions, 15 deletions
diff --git a/cpp/src/qpid/sys/rdma/RdmaIO.cpp b/cpp/src/qpid/sys/rdma/RdmaIO.cpp
index 52de923248..6591c6e676 100644
--- a/cpp/src/qpid/sys/rdma/RdmaIO.cpp
+++ b/cpp/src/qpid/sys/rdma/RdmaIO.cpp
@@ -94,14 +94,11 @@ namespace Rdma {
//qpid::sys::ScopedLock<qpid::sys::Mutex> l(stateLock);
do {
newState = oldState = state.get();
- doReturn = false;
- if (oldState != IDLE && oldState != DRAINED) {
- doReturn = true;
- break;
+ doReturn = true;
+ if (oldState == IDLE || oldState == DRAINED) {
+ doReturn = false;
+ newState = SHUTDOWN;
}
-
- newState = SHUTDOWN;
-
} while (!state.boolCompareAndSwap(oldState, newState));
// Ensure we can't get any more callbacks (except for the stopped callback)
@@ -125,14 +122,12 @@ namespace Rdma {
//qpid::sys::ScopedLock<qpid::sys::Mutex> l(stateLock);
do {
newState = oldState = state.get();
- doReturn = false;
- if (oldState != IDLE) {
- doReturn = true;
- break;
- }
-
- if (outstandingWrites == 0) {
- newState = DRAINED;
+ doReturn = true;
+ if (oldState == IDLE) {
+ doReturn = false;
+ if (outstandingWrites == 0) {
+ newState = DRAINED;
+ }
}
} while (!state.boolCompareAndSwap(oldState, newState));
if (doReturn) {