summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-12-02 18:34:06 +0000
committerGordon Sim <gsim@apache.org>2008-12-02 18:34:06 +0000
commitbb9025d388d7c1a0f6b4f471e05e51bfb191ea56 (patch)
tree26b7f394a34bb8a9e90f3b888ad660aa84eabc63 /cpp/src
parent7ac157d163171107cfff528e2c54084dac896fb1 (diff)
downloadqpid-python-bb9025d388d7c1a0f6b4f471e05e51bfb191ea56.tar.gz
Avoid potential deadlock between IO thread in Connector::handleClosed() and application thread in ConnectionImpl::closed()
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@722554 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/client/ConnectionImpl.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/cpp/src/qpid/client/ConnectionImpl.cpp b/cpp/src/qpid/client/ConnectionImpl.cpp
index b284fb6312..0d7ffa0288 100644
--- a/cpp/src/qpid/client/ConnectionImpl.cpp
+++ b/cpp/src/qpid/client/ConnectionImpl.cpp
@@ -134,7 +134,10 @@ void ConnectionImpl::close()
template <class F> void ConnectionImpl::closeInternal(const F& f) {
- connector->close();
+ {
+ Mutex::ScopedUnlock u(lock);
+ connector->close();
+ }
//notifying sessions of failure can result in those session being
//deleted which in turn results in a call to erase(); this can
//even happen on this thread, when 's' goes out of scope