diff options
author | Ted Ross <tross@apache.org> | 2009-08-31 20:18:48 +0000 |
---|---|---|
committer | Ted Ross <tross@apache.org> | 2009-08-31 20:18:48 +0000 |
commit | 057d6d27d53a55ba19eaff8487727ab5d9df2768 (patch) | |
tree | c5df8c9a1ab3fa771a230f4a267c1379c9db2659 /qpid/cpp/src/qmf/ResilientConnection.cpp | |
parent | 1f34f75150deddcae3b8717c974b4dcaf7e1b974 (diff) | |
download | qpid-python-057d6d27d53a55ba19eaff8487727ab5d9df2768.tar.gz |
Added protocol module for codepoint definitions and header handling.
Fixed a deadlock case in ResilientConnection.
Added more code to the ConsoleEngine implementation.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@809728 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/qmf/ResilientConnection.cpp')
-rw-r--r-- | qpid/cpp/src/qmf/ResilientConnection.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/qpid/cpp/src/qmf/ResilientConnection.cpp b/qpid/cpp/src/qmf/ResilientConnection.cpp index 88b9169c75..a6f9eddcde 100644 --- a/qpid/cpp/src/qmf/ResilientConnection.cpp +++ b/qpid/cpp/src/qmf/ResilientConnection.cpp @@ -318,6 +318,7 @@ void ResilientConnectionImpl::run() while (true) { try { + QPID_LOG(trace, "Trying to open connection..."); connection.open(settings.impl->getClientSettings()); { Mutex::ScopedLock _lock(lock); @@ -326,6 +327,7 @@ void ResilientConnectionImpl::run() while (connected) cond.wait(lock); + delay = delayMin; while (!sessions.empty()) { set<RCSession::Ptr>::iterator iter = sessions.begin(); @@ -334,6 +336,11 @@ void ResilientConnectionImpl::run() EnqueueEvent(ResilientConnectionEvent::SESSION_CLOSED, sess->userContext); Mutex::ScopedUnlock _u(lock); sess->stop(); + + // Nullify the intrusive pointer within the scoped unlock, otherwise, + // the reference is held until overwritted above (under lock) which causes + // the session destructor to be called with the lock held. + sess = 0; } EnqueueEvent(ResilientConnectionEvent::DISCONNECTED); @@ -341,7 +348,6 @@ void ResilientConnectionImpl::run() if (shutdown) return; } - delay = delayMin; connection.close(); } catch (exception &e) { QPID_LOG(debug, "connection.open exception: " << e.what()); |