qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r1515483 - in /qpid/branches/0.24/qpid: ./ cpp/src/ cpp/src/qpid/broker/ cpp/src/qpid/broker/Queue.cpp
Date Mon, 19 Aug 2013 16:07:32 GMT
Author: gsim
Date: Mon Aug 19 16:07:32 2013
New Revision: 1515483

URL: http://svn.apache.org/r1515483
Log:
QPID-5078: ensure listeners are always notified if a message was left on the queue (merged
from r1514907)

Modified:
    qpid/branches/0.24/qpid/   (props changed)
    qpid/branches/0.24/qpid/cpp/src/   (props changed)
    qpid/branches/0.24/qpid/cpp/src/qpid/broker/   (props changed)
    qpid/branches/0.24/qpid/cpp/src/qpid/broker/Queue.cpp

Propchange: qpid/branches/0.24/qpid/
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid:r1514907

Propchange: qpid/branches/0.24/qpid/cpp/src/
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/cpp/src:r1514907

Propchange: qpid/branches/0.24/qpid/cpp/src/qpid/broker/
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/cpp/src/qpid/broker:r1514907

Modified: qpid/branches/0.24/qpid/cpp/src/qpid/broker/Queue.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/0.24/qpid/cpp/src/qpid/broker/Queue.cpp?rev=1515483&r1=1515482&r2=1515483&view=diff
==============================================================================
--- qpid/branches/0.24/qpid/cpp/src/qpid/broker/Queue.cpp (original)
+++ qpid/branches/0.24/qpid/cpp/src/qpid/broker/Queue.cpp Mon Aug 19 16:07:32 2013
@@ -385,6 +385,7 @@ bool Queue::getNextMessage(Message& m, C
     if (!checkNotDeleted(c)) return false;
     QueueListeners::NotificationSet set;
     ScopedAutoDelete autodelete(*this);
+    bool messageFound(false);
     while (true) {
         //TODO: reduce lock scope
         Mutex::ScopedLock locker(messageLock);
@@ -426,7 +427,8 @@ bool Queue::getNextMessage(Message& m, C
                     QPID_LOG(debug, "Message " << msg->getSequence() << "
retrieved from '"
                              << name << "'");
                     m = *msg;
-                    return true;
+                    messageFound = true;
+                    break;
                 } else {
                     //message(s) are available but consumer hasn't got enough credit
                     QPID_LOG(debug, "Consumer can't currently accept message from '" <<
name << "'");
@@ -448,11 +450,12 @@ bool Queue::getNextMessage(Message& m, C
         } else {
             QPID_LOG(debug, "No messages to dispatch on queue '" << name << "'");
             listeners.addListener(c);
-            return false;
+            break;
         }
+
     }
     set.notify();
-    return false;
+    return messageFound;
 }
 
 void Queue::removeListener(Consumer::shared_ptr c)



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message