diff options
author | Clifford Allan Jansen <cliffjansen@apache.org> | 2012-09-30 19:23:37 +0000 |
---|---|---|
committer | Clifford Allan Jansen <cliffjansen@apache.org> | 2012-09-30 19:23:37 +0000 |
commit | 694a0fb6c874a1bbf1d3eeeca6c18952a78b9f28 (patch) | |
tree | 7f3456ac3134c777c609d43fc53ae3d7feaf4fff /cpp/src/qpid/client/ConnectionImpl.cpp | |
parent | 09818cb3d22e99ca30f1fafb7e296ba0b2e9f622 (diff) | |
download | qpid-python-694a0fb6c874a1bbf1d3eeeca6c18952a78b9f28.tar.gz |
QPID-4330: Windows static destructors: threadSafeShutdown() test
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1392093 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/ConnectionImpl.cpp')
-rw-r--r-- | cpp/src/qpid/client/ConnectionImpl.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/cpp/src/qpid/client/ConnectionImpl.cpp b/cpp/src/qpid/client/ConnectionImpl.cpp index 85b0e8303e..0abfbe09ec 100644 --- a/cpp/src/qpid/client/ConnectionImpl.cpp +++ b/cpp/src/qpid/client/ConnectionImpl.cpp @@ -128,15 +128,17 @@ public: // and we can't do that before we're unloaded as we can't // restart the Poller after shutting it down ~IOThread() { - std::vector<Thread> threads; - { - ScopedLock<Mutex> l(threadLock); - if (poller_) - poller_->shutdown(); - t.swap(threads); - } - for (std::vector<Thread>::iterator i = threads.begin(); i != threads.end(); ++i) { - i->join(); + if (SystemInfo::threadSafeShutdown()) { + std::vector<Thread> threads; + { + ScopedLock<Mutex> l(threadLock); + if (poller_) + poller_->shutdown(); + t.swap(threads); + } + for (std::vector<Thread>::iterator i = threads.begin(); i != threads.end(); ++i) { + i->join(); + } } } }; |