summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client/ConnectionImpl.cpp
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2009-06-01 22:30:24 +0000
committerAndrew Stitcher <astitcher@apache.org>2009-06-01 22:30:24 +0000
commit31cdbb90eb2bef73d8a8e9ae2e68f771683a7ce1 (patch)
tree9b9bc229cef21d02aaed68325a030fa55b9669cb /cpp/src/qpid/client/ConnectionImpl.cpp
parent20a83ba3acd18fffdf20785ef8c39fb6c1997143 (diff)
downloadqpid-python-31cdbb90eb2bef73d8a8e9ae2e68f771683a7ce1.tar.gz
Some fixes to QPID-1879 so that clustering still works:
Change client io threading to be initialised at first use Stop linking loadable modules with tests Add some sentinel values so that we can see what happened last git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@780855 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/ConnectionImpl.cpp')
-rw-r--r--cpp/src/qpid/client/ConnectionImpl.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/cpp/src/qpid/client/ConnectionImpl.cpp b/cpp/src/qpid/client/ConnectionImpl.cpp
index ccaa8c0b87..2fdf4d1d25 100644
--- a/cpp/src/qpid/client/ConnectionImpl.cpp
+++ b/cpp/src/qpid/client/ConnectionImpl.cpp
@@ -130,7 +130,10 @@ public:
}
};
-static IOThread io(SystemInfo::concurrency());
+IOThread& theIO() {
+ static IOThread io(SystemInfo::concurrency());
+ return io;
+}
class HeartbeatTask : public TimerTask {
TimeoutHandler& timeout;
@@ -173,7 +176,7 @@ ConnectionImpl::~ConnectionImpl() {
// is running.
failover.reset();
if (connector) connector->close();
- io.sub();
+ theIO().sub();
}
void ConnectionImpl::addSession(const boost::shared_ptr<SessionImpl>& session, uint16_t channel)
@@ -217,8 +220,8 @@ void ConnectionImpl::open()
int port = handler.port;
QPID_LOG(info, "Connecting to " << protocol << ":" << host << ":" << port);
- io.add();
- connector.reset(Connector::create(protocol, io.poller(), version, handler, this));
+ theIO().add();
+ connector.reset(Connector::create(protocol, theIO().poller(), version, handler, this));
connector->setInputHandler(&handler);
connector->setShutdownHandler(this);
connector->connect(host, port);