diff options
author | Benoit Foucher <benoit@zeroc.com> | 2018-11-12 13:16:10 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2018-11-12 13:16:10 +0100 |
commit | 17543bdb79d56062d05491229f492feaa7a1eaa5 (patch) | |
tree | 53e39686bb4aa8d448aaf8ecab1b189c28e62643 /cpp/src/Ice/ConnectionFactory.cpp | |
parent | Fixed bogus whitespaces (diff) | |
download | ice-17543bdb79d56062d05491229f492feaa7a1eaa5.tar.bz2 ice-17543bdb79d56062d05491229f492feaa7a1eaa5.tar.xz ice-17543bdb79d56062d05491229f492feaa7a1eaa5.zip |
Fixed rare race condition which could trigger an assert on OA destruction, fixes #291
Diffstat (limited to 'cpp/src/Ice/ConnectionFactory.cpp')
-rw-r--r-- | cpp/src/Ice/ConnectionFactory.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/cpp/src/Ice/ConnectionFactory.cpp b/cpp/src/Ice/ConnectionFactory.cpp index e61c0ac6f35..3e0aca17ba8 100644 --- a/cpp/src/Ice/ConnectionFactory.cpp +++ b/cpp/src/Ice/ConnectionFactory.cpp @@ -1566,6 +1566,16 @@ IceInternal::IncomingConnectionFactory::finished(ThreadPoolCurrent&, bool close) { closeAcceptor(); } + + // + // If the acceptor hasn't been explicitly stopped (which is the case if the acceptor got closed + // because of an unexpected error), try to restart the acceptor in 1 second. + // + if(!_acceptorStopped) + { + _instance->timer()->schedule(ICE_MAKE_SHARED(StartAcceptor, ICE_SHARED_FROM_THIS, _instance), + IceUtil::Time::seconds(1)); + } return; } @@ -1925,14 +1935,4 @@ IceInternal::IncomingConnectionFactory::closeAcceptor() _acceptorStarted = false; _acceptor->close(); - - // - // If the acceptor hasn't been explicitly stopped (which is the case if the acceptor got closed - // because of an unexpected error), try to restart the acceptor in 1 second. - // - if(!_acceptorStopped && (_state == StateHolding || _state == StateActive)) - { - _instance->timer()->schedule(ICE_MAKE_SHARED(StartAcceptor, ICE_SHARED_FROM_THIS, _instance), - IceUtil::Time::seconds(1)); - } } |