diff options
Diffstat (limited to 'cpp/demo/Ice/session/ReapThread.cpp')
-rwxr-xr-x | cpp/demo/Ice/session/ReapThread.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/cpp/demo/Ice/session/ReapThread.cpp b/cpp/demo/Ice/session/ReapThread.cpp index 26d25ff506a..7257bd0994c 100755 --- a/cpp/demo/Ice/session/ReapThread.cpp +++ b/cpp/demo/Ice/session/ReapThread.cpp @@ -25,38 +25,38 @@ ReapThread::run() while(!_terminated) { - timedWait(_timeout); + timedWait(_timeout); - if(!_terminated) - { - list<SessionProxyPair>::iterator p = _sessions.begin(); - while(p != _sessions.end()) - { - try - { - // - // Session destruction may take time in a - // real-world example. Therefore the current time - // is computed for each iteration. - // - if((IceUtil::Time::now() - p->session->timestamp()) > _timeout) - { - string name = p->proxy->getName(); - p->proxy->destroy(); - cout << "The session " << name << " has timed out." << endl; - p = _sessions.erase(p); - } - else - { - ++p; - } - } - catch(const Ice::ObjectNotExistException&) - { - p = _sessions.erase(p); - } - } - } + if(!_terminated) + { + list<SessionProxyPair>::iterator p = _sessions.begin(); + while(p != _sessions.end()) + { + try + { + // + // Session destruction may take time in a + // real-world example. Therefore the current time + // is computed for each iteration. + // + if((IceUtil::Time::now() - p->session->timestamp()) > _timeout) + { + string name = p->proxy->getName(); + p->proxy->destroy(); + cout << "The session " << name << " has timed out." << endl; + p = _sessions.erase(p); + } + else + { + ++p; + } + } + catch(const Ice::ObjectNotExistException&) + { + p = _sessions.erase(p); + } + } + } } } |