summaryrefslogtreecommitdiff
path: root/cpp/demo/Glacier2/chat/Client.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2008-06-03 10:03:41 -0700
committerBenoit Foucher <benoit@zeroc.com>2008-06-06 15:28:19 +0200
commit1b07dbb3a4f7f272d03fd8b4cd563416677cfe4e (patch)
tree831fb7e12ba69e53284d69cd4d7e187100db1c4b /cpp/demo/Glacier2/chat/Client.cpp
parentBug 3220 - some minor renaming (diff)
downloadice-1b07dbb3a4f7f272d03fd8b4cd563416677cfe4e.tar.bz2
ice-1b07dbb3a4f7f272d03fd8b4cd563416677cfe4e.tar.xz
ice-1b07dbb3a4f7f272d03fd8b4cd563416677cfe4e.zip
cleaning up C++ Glacier2 demos
Diffstat (limited to 'cpp/demo/Glacier2/chat/Client.cpp')
-rw-r--r--cpp/demo/Glacier2/chat/Client.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/cpp/demo/Glacier2/chat/Client.cpp b/cpp/demo/Glacier2/chat/Client.cpp
index 5448eb880c2..880b0af4ce8 100644
--- a/cpp/demo/Glacier2/chat/Client.cpp
+++ b/cpp/demo/Glacier2/chat/Client.cpp
@@ -116,14 +116,11 @@ public:
return EXIT_FAILURE;
}
+ _router = Glacier2::RouterPrx::checkedCast(defaultRouter);
+ if(!_router)
{
- IceUtil::Mutex::Lock sync(_mutex);
- _router = Glacier2::RouterPrx::checkedCast(defaultRouter);
- if(!_router)
- {
- cerr << argv[0] << ": configured router is not a Glacier2 router" << endl;
- return EXIT_FAILURE;
- }
+ cerr << argv[0] << ": configured router is not a Glacier2 router" << endl;
+ return EXIT_FAILURE;
}
ChatSessionPrx session;
@@ -152,11 +149,8 @@ public:
}
}
- {
- IceUtil::Mutex::Lock sync(_mutex);
- _ping = new SessionPingThread(session, (long)_router->getSessionTimeout() / 2);
- _ping->start();
- }
+ _ping = new SessionPingThread(session, (long)_router->getSessionTimeout() / 2);
+ _ping->start();
Ice::Identity callbackReceiverIdent;
callbackReceiverIdent.name = "callbackReceiver";
@@ -215,7 +209,6 @@ private:
void
cleanup()
{
- IceUtil::Mutex::Lock sync(_mutex);
if(_router)
{
try
@@ -256,7 +249,6 @@ private:
return s;
}
- IceUtil::Mutex _mutex;
Glacier2::RouterPrx _router;
SessionPingThreadPtr _ping;
};