From f5e02db0308f72c71acf7d13c2d10c5d35325e0f Mon Sep 17 00:00:00 2001 From: Andrew Stitcher Date: Wed, 3 Jun 2009 13:52:37 +0000 Subject: Revert "Change client io threading to be initialised at first use" This reverts commit 2e77e9b85912ccbfd29763710a973d0bbff9c684. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@781375 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/client/ConnectionImpl.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'cpp/src/qpid/client/ConnectionImpl.cpp') diff --git a/cpp/src/qpid/client/ConnectionImpl.cpp b/cpp/src/qpid/client/ConnectionImpl.cpp index 2fdf4d1d25..ccaa8c0b87 100644 --- a/cpp/src/qpid/client/ConnectionImpl.cpp +++ b/cpp/src/qpid/client/ConnectionImpl.cpp @@ -130,10 +130,7 @@ public: } }; -IOThread& theIO() { - static IOThread io(SystemInfo::concurrency()); - return io; -} +static IOThread io(SystemInfo::concurrency()); class HeartbeatTask : public TimerTask { TimeoutHandler& timeout; @@ -176,7 +173,7 @@ ConnectionImpl::~ConnectionImpl() { // is running. failover.reset(); if (connector) connector->close(); - theIO().sub(); + io.sub(); } void ConnectionImpl::addSession(const boost::shared_ptr& session, uint16_t channel) @@ -220,8 +217,8 @@ void ConnectionImpl::open() int port = handler.port; QPID_LOG(info, "Connecting to " << protocol << ":" << host << ":" << port); - theIO().add(); - connector.reset(Connector::create(protocol, theIO().poller(), version, handler, this)); + io.add(); + connector.reset(Connector::create(protocol, io.poller(), version, handler, this)); connector->setInputHandler(&handler); connector->setShutdownHandler(this); connector->connect(host, port); -- cgit v1.2.1