summaryrefslogtreecommitdiff
path: root/cpp/demo/Ice/session/ReapThread.h
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2005-04-20 00:19:09 +0000
committerMatthew Newhook <matthew@zeroc.com>2005-04-20 00:19:09 +0000
commite6b18342bcab622b131f1634fb67fbaaeb356465 (patch)
treebc8d1f6312e2b8ea61f1ee1af7566da06b7adc44 /cpp/demo/Ice/session/ReapThread.h
parentmerging a fix for bug 228 (diff)
downloadice-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-xcpp/demo/Ice/session/ReapThread.h17
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;