diff options
author | Ted Ross <tross@apache.org> | 2011-09-16 14:34:39 +0000 |
---|---|---|
committer | Ted Ross <tross@apache.org> | 2011-09-16 14:34:39 +0000 |
commit | ab66e50da3f39257590b941ab1fabd709e298c8f (patch) | |
tree | 5fda155ed9c6fe2d3fed8681de577501dcd5921f /qpid/cpp/src/qmf/ConsoleSession.cpp | |
parent | 0f4893206428cea8b6b9af46ed2fdacc7b7d834f (diff) | |
download | qpid-python-ab66e50da3f39257590b941ab1fabd709e298c8f.tar.gz |
QPID-3484 - Added missing constructor for EventNotifier, fixed initialization bug.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1171592 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/qmf/ConsoleSession.cpp')
-rw-r--r-- | qpid/cpp/src/qmf/ConsoleSession.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/qpid/cpp/src/qmf/ConsoleSession.cpp b/qpid/cpp/src/qmf/ConsoleSession.cpp index d084b8a8eb..2dfc894c58 100644 --- a/qpid/cpp/src/qmf/ConsoleSession.cpp +++ b/qpid/cpp/src/qmf/ConsoleSession.cpp @@ -67,7 +67,7 @@ Subscription ConsoleSession::subscribe(const string& q, const string& f, const s ConsoleSessionImpl::ConsoleSessionImpl(Connection& c, const string& options) : connection(c), domain("default"), maxAgentAgeMinutes(5), listenOnDirect(true), strictSecurity(false), maxThreadWaitTime(5), - opened(false), thread(0), threadCanceled(false), lastVisit(0), lastAgePass(0), + opened(false), eventNotifier(0), thread(0), threadCanceled(false), lastVisit(0), lastAgePass(0), connectedBrokerInAgentList(false), schemaCache(new SchemaCache()), nextCorrelator(1) { if (!options.empty()) { @@ -210,7 +210,7 @@ void ConsoleSessionImpl::open() } -void ConsoleSessionImpl::close() +void ConsoleSessionImpl::closeAsync() { if (!opened) throw QmfException("The session is already closed"); @@ -221,6 +221,18 @@ void ConsoleSessionImpl::close() } +void ConsoleSessionImpl::close() +{ + closeAsync(); + + if (thread) { + thread->join(); + delete thread; + thread = 0; + } +} + + bool ConsoleSessionImpl::nextEvent(ConsoleEvent& event, Duration timeout) { uint64_t milliseconds = timeout.getMilliseconds(); @@ -256,14 +268,14 @@ int ConsoleSessionImpl::pendingEvents() const void ConsoleSessionImpl::setEventNotifier(EventNotifierImpl* notifier) { qpid::sys::Mutex::ScopedLock l(lock); - this->eventNotifier = notifier; + eventNotifier = notifier; } EventNotifierImpl* ConsoleSessionImpl::getEventNotifier() const { qpid::sys::Mutex::ScopedLock l(lock); - return this->eventNotifier; + return eventNotifier; } |