summaryrefslogtreecommitdiff
path: root/cpp/demo/Ice/bidir/CallbackI.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/demo/Ice/bidir/CallbackI.h')
-rw-r--r--cpp/demo/Ice/bidir/CallbackI.h32
1 files changed, 2 insertions, 30 deletions
diff --git a/cpp/demo/Ice/bidir/CallbackI.h b/cpp/demo/Ice/bidir/CallbackI.h
index f3fe245c98b..a7c9fe154fa 100644
--- a/cpp/demo/Ice/bidir/CallbackI.h
+++ b/cpp/demo/Ice/bidir/CallbackI.h
@@ -17,7 +17,7 @@
class CallbackSenderI;
typedef IceUtil::Handle<CallbackSenderI> CallbackSenderIPtr;
-class CallbackSenderI : public Demo::CallbackSender, public IceUtil::Monitor<IceUtil::Mutex>
+class CallbackSenderI : public Demo::CallbackSender, public IceUtil::Thread, public IceUtil::Monitor<IceUtil::Mutex>
{
public:
@@ -27,41 +27,13 @@ public:
virtual void addClient(const Ice::Identity&, const Ice::Current&);
- void start();
- void run();
+ virtual void run();
private:
Ice::CommunicatorPtr _communicator;
bool _destroy;
std::set<Demo::CallbackReceiverPrx> _clients;
-
- //
- // We cannot derive CallbackSenderI from IceUtil::Thread, because
- // CallbackSenderI uses IceUtil::GCShared as base, and
- // IceUtil::Thread uses IceUtil::Shared as base. These two base
- // classes are not compatible. Therefore we use this helper class.
- //
- class CallbackSenderThread : public IceUtil::Thread
- {
- public:
-
- CallbackSenderThread(const CallbackSenderIPtr& callbackSender) :
- _callbackSender(callbackSender)
- {
- }
-
- virtual void run()
- {
- _callbackSender->run();
- }
-
- private:
-
- const CallbackSenderIPtr _callbackSender;
- };
-
- IceUtil::ThreadPtr _callbackSenderThread;
};
#endif