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 | 13b692aac42bc0e896a31c176daf79920a82ea5e (patch) | |
| tree | a2b1b18ae6e3667afae4ce5f7d3331f7d9188057 /cpp/src/qmf/ResilientConnection.cpp | |
| parent | a7d34ad1929e3d63e5cab290090d60920dfdd32c (diff) | |
| download | qpid-python-13b692aac42bc0e896a31c176daf79920a82ea5e.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/qpid@809728 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qmf/ResilientConnection.cpp')
| -rw-r--r-- | cpp/src/qmf/ResilientConnection.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cpp/src/qmf/ResilientConnection.cpp b/cpp/src/qmf/ResilientConnection.cpp index 88b9169c75..a6f9eddcde 100644 --- a/cpp/src/qmf/ResilientConnection.cpp +++ b/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()); |
