Skip to content
Browse files

fix https://issues.apache.org/jira/browse/AMQCPP-520

  • Loading branch information...
1 parent e97905f commit c5a9f4521693281878864e919d42a239c5961293 @tabish121 tabish121 committed Oct 22, 2013
Showing with 9 additions and 13 deletions.
  1. +9 −13 activemq-cpp/src/main/activemq/transport/failover/FailoverTransport.cpp
View
22 activemq-cpp/src/main/activemq/transport/failover/FailoverTransport.cpp
@@ -690,25 +690,21 @@ void FailoverTransport::restoreTransport(const Pointer<Transport> transport) {
////////////////////////////////////////////////////////////////////////////////
void FailoverTransport::handleTransportFailure(const decaf::lang::Exception& error) {
- Pointer<Transport> transport;
synchronized(&this->impl->reconnectMutex) {
- this->impl->connectedTransport.swap(transport);
- }
-
- if (transport != NULL) {
- if (this->impl->disposedListener != NULL) {
- transport->setTransportListener(this->impl->disposedListener.get());
- }
+ Pointer<Transport> transport;
+ this->impl->connectedTransport.swap(transport);
- // Hand off to the close task so it gets done in a different thread.
- this->impl->closeTask->add(transport);
+ if (transport != NULL) {
- bool reconnectOk = false;
+ if (this->impl->disposedListener != NULL) {
+ transport->setTransportListener(this->impl->disposedListener.get());
+ }
- synchronized(&this->impl->reconnectMutex) {
+ // Hand off to the close task so it gets done in a different thread.
+ this->impl->closeTask->add(transport);
- reconnectOk = this->impl->canReconnect();
+ bool reconnectOk = this->impl->canReconnect();
URI failedUri = *this->impl->connectedTransportURI;
this->impl->initialized = false;

0 comments on commit c5a9f45

Please sign in to comment.
Something went wrong with that request. Please try again.