diff options
Diffstat (limited to 'cpp/src/Ice/ConnectionFactory.cpp')
-rw-r--r-- | cpp/src/Ice/ConnectionFactory.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/cpp/src/Ice/ConnectionFactory.cpp b/cpp/src/Ice/ConnectionFactory.cpp index ae99f562611..1d6227ecd81 100644 --- a/cpp/src/Ice/ConnectionFactory.cpp +++ b/cpp/src/Ice/ConnectionFactory.cpp @@ -510,11 +510,26 @@ IceInternal::IncomingConnectionFactory::connections() const return result; } +namespace IceInternal { + +struct FlushIfValidated +{ + void operator() (ConnectionPtr p) + { + if(p->isValidated()) + { + p->flushBatchRequest(); + } + } +}; + +} + void IceInternal::IncomingConnectionFactory::flushBatchRequests() { - list<ConnectionPtr> c = connections(); // connections() is synchronized, so need to synchronize here. - for_each(c.begin(), c.end(), Ice::voidMemFun(&Connection::flushBatchRequest)); + list<ConnectionPtr> c = connections(); // connections() is synchronized, so no need to synchronize here. + for_each(c.begin(), c.end(), FlushIfValidated()); } bool |