diff options
Diffstat (limited to 'cpp/src/qpid/broker/Queue.cpp')
-rw-r--r-- | cpp/src/qpid/broker/Queue.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/cpp/src/qpid/broker/Queue.cpp b/cpp/src/qpid/broker/Queue.cpp index 2fe5de2dc9..4fae1086d5 100644 --- a/cpp/src/qpid/broker/Queue.cpp +++ b/cpp/src/qpid/broker/Queue.cpp @@ -15,9 +15,10 @@ * limitations under the License. * */ -#include "qpid/broker/Queue.h" -#include "qpid/broker/MessageStore.h" -#include "qpid/sys/Monitor.h" +#include <qpid/broker/Queue.h> +#include <qpid/broker/MessageStore.h> +#include <qpid/sys/Monitor.h> +#include <qpid/sys/Time.h> #include <iostream> using namespace qpid::broker; @@ -38,7 +39,7 @@ Queue::Queue(const string& _name, u_int32_t _autodelete, exclusive(0), persistenceId(0) { - if(autodelete) lastUsed = getTimeMsecs(); + if(autodelete) lastUsed = Time::now().msecs(); } Queue::~Queue(){ @@ -133,7 +134,7 @@ void Queue::consume(Consumer* c, bool requestExclusive){ void Queue::cancel(Consumer* c){ Mutex::ScopedLock locker(lock); consumers.erase(find(consumers.begin(), consumers.end(), c)); - if(autodelete && consumers.empty()) lastUsed = getTimeMsecs(); + if(autodelete && consumers.empty()) lastUsed = Time::now().msecs(); if(exclusive == c) exclusive = 0; } @@ -166,7 +167,7 @@ u_int32_t Queue::getConsumerCount() const{ bool Queue::canAutoDelete() const{ Mutex::ScopedLock locker(lock); - return lastUsed && (getTimeMsecs() - lastUsed > autodelete); + return lastUsed && (Time::now().msecs() - lastUsed > autodelete); } void Queue::enqueue(TransactionContext* ctxt, Message::shared_ptr& msg, const string * const xid) |