From bb9025d388d7c1a0f6b4f471e05e51bfb191ea56 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/qpid@722554 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/client/ConnectionImpl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cpp/src') 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 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