diff options
| author | Clifford Jansen <cliffjansen@apache.org> | 2012-09-30 19:23:37 +0000 |
|---|---|---|
| committer | Clifford Jansen <cliffjansen@apache.org> | 2012-09-30 19:23:37 +0000 |
| commit | 9b27ac1dc4590c1a961315203bc3da08768372ad (patch) | |
| tree | 7f3456ac3134c777c609d43fc53ae3d7feaf4fff /cpp/src/qpid/client/ConnectionImpl.cpp | |
| parent | fa24cecbbc7c32a7dd91fedacd09fccf01a99243 (diff) | |
| download | qpid-python-9b27ac1dc4590c1a961315203bc3da08768372ad.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(); + } } } }; |
