diff options
author | Matthew Newhook <matthew@zeroc.com> | 2005-09-12 02:46:32 +0000 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2005-09-12 02:46:32 +0000 |
commit | 759f7f34281a2c3d406ce93e52e63272a9d4beba (patch) | |
tree | 491339afc3ba74316d9d9019318836ffb6621ce8 /cpp/demo/Glacier2/chat/ChatSessionI.cpp | |
parent | bug fix to the icepack hello demo. (diff) | |
download | ice-759f7f34281a2c3d406ce93e52e63272a9d4beba.tar.bz2 ice-759f7f34281a2c3d406ce93e52e63272a9d4beba.tar.xz ice-759f7f34281a2c3d406ce93e52e63272a9d4beba.zip |
http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=335
Diffstat (limited to 'cpp/demo/Glacier2/chat/ChatSessionI.cpp')
-rwxr-xr-x | cpp/demo/Glacier2/chat/ChatSessionI.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/cpp/demo/Glacier2/chat/ChatSessionI.cpp b/cpp/demo/Glacier2/chat/ChatSessionI.cpp index 22e703885c4..bc6b9ca366b 100755 --- a/cpp/demo/Glacier2/chat/ChatSessionI.cpp +++ b/cpp/demo/Glacier2/chat/ChatSessionI.cpp @@ -7,13 +7,11 @@ // // ********************************************************************** -#include <Ice/Ice.h> #include <ChatSessionI.h> - +#include <Ice/Ice.h> #include <list> using namespace std; -using namespace Ice; using namespace Demo; class ChatRoom; @@ -55,18 +53,18 @@ ChatRoom::instance() void ChatRoom::enter(const ChatCallbackPrx& callback) { - IceUtil::Mutex::Lock sync(*this); + Lock sync(*this); _members.push_back(ChatCallbackPrx::uncheckedCast(callback->ice_oneway())); } void ChatRoom::leave(const ChatCallbackPrx& callback) { - IceUtil::Mutex::Lock sync(*this); + Lock sync(*this); list<ChatCallbackPrx>::iterator p; for(p = _members.begin(); p != _members.end(); ++p) { - if(proxyIdentityEqual(callback, *p)) + if(Ice::proxyIdentityEqual(callback, *p)) { break; } @@ -79,14 +77,14 @@ ChatRoom::leave(const ChatCallbackPrx& callback) void ChatRoom::message(const string& data) const { - IceUtil::Mutex::Lock sync(*this); + Lock sync(*this); for(list<ChatCallbackPrx>::const_iterator p = _members.begin(); p != _members.end(); ++p) { try { (*p)->message(data); } - catch(const LocalException&) + catch(const Ice::LocalException&) { } } @@ -98,9 +96,9 @@ ChatSessionI::ChatSessionI(const string& userId) : } void -ChatSessionI::setCallback(const ChatCallbackPrx& callback, const Current& current) +ChatSessionI::setCallback(const ChatCallbackPrx& callback, const Ice::Current& current) { - IceUtil::Mutex::Lock sync(*this); + Lock sync(*this); if(!_callback) { _callback = callback; @@ -111,15 +109,15 @@ ChatSessionI::setCallback(const ChatCallbackPrx& callback, const Current& curren } void -ChatSessionI::say(const string& data, const Current&) +ChatSessionI::say(const string& data, const Ice::Current&) { ChatRoom::instance()->message(_userId + " says: " + data); } void -ChatSessionI::destroy(const Current& current) +ChatSessionI::destroy(const Ice::Current& current) { - IceUtil::Mutex::Lock sync(*this); + Lock sync(*this); if(_callback) { ChatRoomPtr chatRoom = ChatRoom::instance(); |