diff options
| author | Alan Conway <aconway@apache.org> | 2006-11-29 14:36:08 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2006-11-29 14:36:08 +0000 |
| commit | b13e1a24fcca8797b7be5a242f164afbe17ec4f6 (patch) | |
| tree | ef0362e52c125bc75b07ef3e374dabfa52254e98 /cpp/src/qpid/broker | |
| parent | 16d818e749462daf5e0e43079b2e48991646c619 (diff) | |
| download | qpid-python-b13e1a24fcca8797b7be5a242f164afbe17ec4f6.tar.gz | |
Posix EventChannel implementation using epoll. Placeholder for kevents.
Dynamic thread pool EventChannelThreads to serve EventChannel.
Misc cleanup/enhancements.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@480582 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker')
| -rw-r--r-- | cpp/src/qpid/broker/AutoDelete.cpp | 2 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/AutoDelete.h | 5 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/Configuration.cpp | 2 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/FanOutExchange.cpp | 3 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/Queue.cpp | 6 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/TopicExchange.cpp | 3 |
6 files changed, 11 insertions, 10 deletions
diff --git a/cpp/src/qpid/broker/AutoDelete.cpp b/cpp/src/qpid/broker/AutoDelete.cpp index 6c7ad432db..45232f154c 100644 --- a/cpp/src/qpid/broker/AutoDelete.cpp +++ b/cpp/src/qpid/broker/AutoDelete.cpp @@ -63,7 +63,7 @@ void AutoDelete::run(){ Monitor::ScopedLock l(monitor); while(!stopped){ process(); - monitor.wait(period * Time::NSEC_PER_MSEC); + monitor.wait(period*TIME_MSEC); } } diff --git a/cpp/src/qpid/broker/AutoDelete.h b/cpp/src/qpid/broker/AutoDelete.h index b706246900..a49014314d 100644 --- a/cpp/src/qpid/broker/AutoDelete.h +++ b/cpp/src/qpid/broker/AutoDelete.h @@ -1,3 +1,5 @@ +#ifndef _AutoDelete_ +#define _AutoDelete_ /* * * Licensed to the Apache Software Foundation (ASF) under one @@ -18,9 +20,6 @@ * under the License. * */ -#ifndef _AutoDelete_ -#define _AutoDelete_ - #include <iostream> #include <queue> #include <qpid/sys/Monitor.h> diff --git a/cpp/src/qpid/broker/Configuration.cpp b/cpp/src/qpid/broker/Configuration.cpp index 39f5c23ee6..1fce1acf4c 100644 --- a/cpp/src/qpid/broker/Configuration.cpp +++ b/cpp/src/qpid/broker/Configuration.cpp @@ -52,7 +52,7 @@ void Configuration::parse(int argc, char** argv){ matched = (*i)->parse(position, argv, argc); } if(!matched){ - std::cout << "Warning: skipping unrecognised option " << argv[position] << std::endl; + std::cout<< "Warning: skipping unrecognised option " << argv[position] << std::endl; position++; } } diff --git a/cpp/src/qpid/broker/FanOutExchange.cpp b/cpp/src/qpid/broker/FanOutExchange.cpp index 0f3223d3a6..932038c4da 100644 --- a/cpp/src/qpid/broker/FanOutExchange.cpp +++ b/cpp/src/qpid/broker/FanOutExchange.cpp @@ -43,7 +43,8 @@ void FanOutExchange::unbind(Queue::shared_ptr queue, const string& /*routingKey* Queue::vector::iterator i = std::find(bindings.begin(), bindings.end(), queue); if (i != bindings.end()) { bindings.erase(i); - // TODO aconway 2006-09-14: What about the ExchangeBinding object? Don't we have to verify routingKey/args match? + // TODO aconway 2006-09-14: What about the ExchangeBinding object? + // Don't we have to verify routingKey/args match? } } diff --git a/cpp/src/qpid/broker/Queue.cpp b/cpp/src/qpid/broker/Queue.cpp index 1150d055cb..00b0a844ab 100644 --- a/cpp/src/qpid/broker/Queue.cpp +++ b/cpp/src/qpid/broker/Queue.cpp @@ -42,7 +42,7 @@ Queue::Queue(const string& _name, u_int32_t _autodelete, exclusive(0), persistenceId(0) { - if(autodelete) lastUsed = Time::now().msecs(); + if(autodelete) lastUsed = now()/TIME_MSEC; } Queue::~Queue(){ @@ -137,7 +137,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 = Time::now().msecs(); + if(autodelete && consumers.empty()) lastUsed = now()*TIME_MSEC; if(exclusive == c) exclusive = 0; } @@ -170,7 +170,7 @@ u_int32_t Queue::getConsumerCount() const{ bool Queue::canAutoDelete() const{ Mutex::ScopedLock locker(lock); - return lastUsed && (Time::now().msecs() - lastUsed > autodelete); + return lastUsed && (now()*TIME_MSEC - lastUsed > autodelete); } void Queue::enqueue(TransactionContext* ctxt, Message::shared_ptr& msg, const string * const xid) diff --git a/cpp/src/qpid/broker/TopicExchange.cpp b/cpp/src/qpid/broker/TopicExchange.cpp index 34fb25781e..938548d091 100644 --- a/cpp/src/qpid/broker/TopicExchange.cpp +++ b/cpp/src/qpid/broker/TopicExchange.cpp @@ -82,7 +82,8 @@ void TopicPattern::normalize() { namespace { // TODO aconway 2006-09-20: Ineficient to convert every routingKey to a string. -// Need more efficient Tokens impl that can operate on a string in place. +// Need StringRef class that operates on a string in place witout copy. +// Should be applied everywhere strings are extracted from frames. // bool do_match(Tokens::const_iterator pattern_begin, Tokens::const_iterator pattern_end, Tokens::const_iterator target_begin, Tokens::const_iterator target_end) { |
