Author: gsim
Date: Tue Dec  2 10:34:06 2008
New Revision: 722554

URL: http://svn.apache.org/viewvc?rev=722554&view=rev
Log:
Avoid potential deadlock between IO thread in Connector::handleClosed() and 
application thread in ConnectionImpl::closed()

Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp?rev=722554&r1=722553&r2=722554&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp Tue Dec  2 
10:34:06 2008
@@ -134,7 +134,10 @@
 
 
 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


Reply via email to