diff options
author | Matthew Newhook <matthew@zeroc.com> | 2005-04-20 00:19:09 +0000 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2005-04-20 00:19:09 +0000 |
commit | e6b18342bcab622b131f1634fb67fbaaeb356465 (patch) | |
tree | bc8d1f6312e2b8ea61f1ee1af7566da06b7adc44 /cpp/demo/Ice/session/ReapThread.h | |
parent | merging a fix for bug 228 (diff) | |
download | ice-e6b18342bcab622b131f1634fb67fbaaeb356465.tar.bz2 ice-e6b18342bcab622b131f1634fb67fbaaeb356465.tar.xz ice-e6b18342bcab622b131f1634fb67fbaaeb356465.zip |
more changes to the session demo.
Diffstat (limited to 'cpp/demo/Ice/session/ReapThread.h')
-rwxr-xr-x | cpp/demo/Ice/session/ReapThread.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/cpp/demo/Ice/session/ReapThread.h b/cpp/demo/Ice/session/ReapThread.h index 012dac82f47..33fdc7333d9 100755 --- a/cpp/demo/Ice/session/ReapThread.h +++ b/cpp/demo/Ice/session/ReapThread.h @@ -14,16 +14,17 @@ #include <IceUtil/StaticMutex.h> #include <SessionI.h> +#include <list> + class ReapThread; typedef IceUtil::Handle<ReapThread> ReapThreadPtr; + class ReapThread : public IceUtil::Thread, public IceUtil::Monitor<IceUtil::Mutex> { public: static ReapThreadPtr& instance(); - virtual ~ReapThread(); // XXX Destructor does nothing, get rid of it. - virtual void run(); void terminate(); @@ -36,10 +37,14 @@ private: const IceUtil::Time _timeout; bool _terminated; - // XXX Why is this a map and not simply a list of - // pair<Demo::SessionPrx, SessionIPtr> (or a list of structs with - // these elements)? The sorting of a map is needed nowhere. - std::map< Demo::SessionPrx, SessionIPtr> _sessions; + struct SessionProxyPair + { + SessionProxyPair(const Demo::SessionPrx& p, const SessionIPtr& s) : + proxy(p), session(s) { } + const Demo::SessionPrx proxy; + const SessionIPtr session; + }; + std::list<SessionProxyPair> _sessions; static ReapThreadPtr _instance; static IceUtil::StaticMutex _instanceMutex; |