diff options
| author | Andrew Stitcher <astitcher@apache.org> | 2010-04-08 04:53:26 +0000 |
|---|---|---|
| committer | Andrew Stitcher <astitcher@apache.org> | 2010-04-08 04:53:26 +0000 |
| commit | 4e485d80018badb68d18cfb20886dd97f18ae7b1 (patch) | |
| tree | 4b6b9ac5a2e929a93b7fc9695e9d6b3bfd7a52f9 /cpp/src/qpid/client/ConnectionImpl.cpp | |
| parent | 91bbbc3dcc995e5955f780948be42cde721528ba (diff) | |
| download | qpid-python-4e485d80018badb68d18cfb20886dd97f18ae7b1.tar.gz | |
Improved fix for to create client library Poller. Improved because it
is now created at first need rather than library load.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@931781 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/ConnectionImpl.cpp')
| -rw-r--r-- | cpp/src/qpid/client/ConnectionImpl.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/cpp/src/qpid/client/ConnectionImpl.cpp b/cpp/src/qpid/client/ConnectionImpl.cpp index 05a781c2d9..b6043518e8 100644 --- a/cpp/src/qpid/client/ConnectionImpl.cpp +++ b/cpp/src/qpid/client/ConnectionImpl.cpp @@ -137,15 +137,6 @@ IOThread& theIO() { return io; } -// Bring theIO into existence on library load rather than first use. -// This avoids it being destroyed whilst something in the main program -// still exists -struct InitAtLoad { - InitAtLoad() { - (void) theIO(); - } -} init; - class HeartbeatTask : public TimerTask { TimeoutHandler& timeout; @@ -164,6 +155,13 @@ public: } +// Ensure the IO threads exist: +// This needs to be called in the Connection constructor +// so that they will still exist at last connection destruction +void ConnectionImpl::init() { + (void) theIO(); +} + ConnectionImpl::ConnectionImpl(framing::ProtocolVersion v, const ConnectionSettings& settings) : Bounds(settings.maxFrameSize * settings.bounds), handler(settings, v), |
