From 7ea9a39bf9c3724dd263f454f99bda9a0ead64d0 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Tue, 2 Dec 2008 18:34:06 +0000 Subject: 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@722554 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/qpid/client/ConnectionImpl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'qpid/cpp/src') diff --git a/qpid/cpp/src/qpid/client/ConnectionImpl.cpp b/qpid/cpp/src/qpid/client/ConnectionImpl.cpp index b284fb6312..0d7ffa0288 100644 --- a/qpid/cpp/src/qpid/client/ConnectionImpl.cpp +++ b/qpid/cpp/src/qpid/client/ConnectionImpl.cpp @@ -134,7 +134,10 @@ void ConnectionImpl::close() template 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 -- cgit v1.2.1