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/Freeze/library/LibraryI.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/Freeze/library/LibraryI.cpp')
-rw-r--r-- | cpp/demo/Freeze/library/LibraryI.cpp | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/cpp/demo/Freeze/library/LibraryI.cpp b/cpp/demo/Freeze/library/LibraryI.cpp index 079c282a43f..96d33c9e61b 100644 --- a/cpp/demo/Freeze/library/LibraryI.cpp +++ b/cpp/demo/Freeze/library/LibraryI.cpp @@ -18,14 +18,10 @@ BookI::BookI(const LibraryIPtr& library) : { } -BookI::~BookI() -{ -} - void BookI::destroy(const Ice::Current&) { - IceUtil::RWRecMutex::RLock sync(*this); + RLock sync(*this); if(_destroyed) { @@ -55,7 +51,7 @@ BookI::destroy(const Ice::Current&) Demo::BookDescription BookI::getBookDescription(const Ice::Current&) const { - IceUtil::RWRecMutex::RLock sync(*this); + RLock sync(*this); if(_destroyed) { @@ -66,10 +62,10 @@ BookI::getBookDescription(const Ice::Current&) const return description; } -::std::string +string BookI::getRenterName(const Ice::Current&) const { - IceUtil::RWRecMutex::RLock sync(*this); + RLock sync(*this); if(_destroyed) { @@ -84,9 +80,9 @@ BookI::getRenterName(const Ice::Current&) const } void -BookI::rentBook(const ::std::string& name, const Ice::Current&) +BookI::rentBook(const string& name, const Ice::Current&) { - IceUtil::RWRecMutex::WLock sync(*this); + WLock sync(*this); if(_destroyed) { @@ -103,7 +99,7 @@ BookI::rentBook(const ::std::string& name, const Ice::Current&) void BookI::returnBook(const Ice::Current&) { - IceUtil::RWRecMutex::WLock sync(*this); + WLock sync(*this); if(_destroyed) { @@ -150,7 +146,7 @@ public: private: - Ice::ObjectAdapterPtr _adapter; + const Ice::ObjectAdapterPtr _adapter; }; LibraryI::LibraryI(const Ice::CommunicatorPtr& communicator, @@ -162,14 +158,10 @@ LibraryI::LibraryI(const Ice::CommunicatorPtr& communicator, { } -LibraryI::~LibraryI() -{ -} - Demo::BookPrx LibraryI::createBook(const Demo::BookDescription& description, const Ice::Current& c) { - IceUtil::RWRecMutex::WLock sync(*this); + WLock sync(*this); #if defined(__SUNPRO_CC) // @@ -235,7 +227,7 @@ LibraryI::findByIsbn(const string& isbn, const Ice::Current& c) const // No locking is necessary since no internal mutable state is // accessed. // - //IceUtil::RWRecMutex::RLock sync(*this); + //RLock sync(*this); try { @@ -255,7 +247,7 @@ LibraryI::findByIsbn(const string& isbn, const Ice::Current& c) const Demo::BookPrxSeq LibraryI::findByAuthors(const string& authors, const Ice::Current& c) const { - IceUtil::RWRecMutex::RLock sync(*this); + RLock sync(*this); // // Lookup all books that match the given authors, and return them @@ -292,7 +284,7 @@ LibraryI::shutdown(const Ice::Current& current) void LibraryI::remove(const BookDescription& description) { - IceUtil::RWRecMutex::WLock sync(*this); + WLock sync(*this); try { @@ -343,4 +335,3 @@ LibraryI::remove(const BookDescription& description) throw e; } } - |