diff options
| author | Carl C. Trieloff <cctrieloff@apache.org> | 2007-08-17 14:51:24 +0000 |
|---|---|---|
| committer | Carl C. Trieloff <cctrieloff@apache.org> | 2007-08-17 14:51:24 +0000 |
| commit | 3fc22899cf5a4c5a26daef65d720c3bb1de3884d (patch) | |
| tree | 20bcc3a9ad51040e2823b5310d62b8f55ae95c2b /cpp/src/qpid | |
| parent | 3e009cb10063457115db198b8faea1b395365b89 (diff) | |
| download | qpid-python-3fc22899cf5a4c5a26daef65d720c3bb1de3884d.tar.gz | |
- corrected getMessageCount() for async messages
- added test for async message count.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@567059 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid')
| -rw-r--r-- | cpp/src/qpid/broker/BrokerQueue.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cpp/src/qpid/broker/BrokerQueue.cpp b/cpp/src/qpid/broker/BrokerQueue.cpp index 3ae2ce8de3..ea092bb33b 100644 --- a/cpp/src/qpid/broker/BrokerQueue.cpp +++ b/cpp/src/qpid/broker/BrokerQueue.cpp @@ -223,9 +223,16 @@ void Queue::push(Message::shared_ptr& msg){ } } +/** function only provided for unit tests, or code not in critical message path */ uint32_t Queue::getMessageCount() const{ Mutex::ScopedLock locker(messageLock); - return messages.size(); + + uint32_t count =0; + for ( Messages::const_iterator i = messages.begin(); i != messages.end(); ++i ) { + if ( (*i)->isEnqueueComplete() ) count ++; + } + + return count; } uint32_t Queue::getConsumerCount() const{ |
