From 32f04433aebc19c9dcc89f3f5a3cf313b8100672 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Tue, 5 Feb 2008 20:44:14 +0000 Subject: Added testSendToSelf for https://bugzilla.redhat.com/show_bug.cgi?id=410551 M src/tests/ClientSessionTest.cpp Disabled management for BrokerFixture - management singleton assumes only one broker per process, causes shutdown races with fixtures. M src/tests/BrokerFixture.h Made Timer::stop() idempotent M src/qpid/broker/Timer.cpp M src/qpid/broker/Timer.h Added STL-style size() and empty() M src/qpid/sys/BlockingQueue.h M src/qpid/client/LocalQueue.cpp M src/qpid/client/LocalQueue.h git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@618770 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/Timer.cpp | 12 ++++-------- cpp/src/qpid/broker/Timer.h | 1 - 2 files changed, 4 insertions(+), 9 deletions(-) (limited to 'cpp/src/qpid/broker') diff --git a/cpp/src/qpid/broker/Timer.cpp b/cpp/src/qpid/broker/Timer.cpp index 28b1aa56d7..173f350cde 100644 --- a/cpp/src/qpid/broker/Timer.cpp +++ b/cpp/src/qpid/broker/Timer.cpp @@ -85,17 +85,13 @@ void Timer::start() void Timer::stop() { - signalStop(); - runner.join(); -} - -void Timer::signalStop() -{ - Monitor::ScopedLock l(monitor); - if (active) { + { + Monitor::ScopedLock l(monitor); + if (!active) return; active = false; monitor.notifyAll(); } + runner.join(); } bool Later::operator()(const intrusive_ptr& a, diff --git a/cpp/src/qpid/broker/Timer.h b/cpp/src/qpid/broker/Timer.h index d1f606f326..dcb02a5e0a 100644 --- a/cpp/src/qpid/broker/Timer.h +++ b/cpp/src/qpid/broker/Timer.h @@ -59,7 +59,6 @@ class Timer : private qpid::sys::Runnable { bool active; virtual void run(); - void signalStop(); public: Timer(); -- cgit v1.2.1