summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2002-12-16 13:20:29 +0000
committerMarc Laukien <marc@zeroc.com>2002-12-16 13:20:29 +0000
commit5e75e520d4080bcf13346de56509c84b4c4b90a6 (patch)
tree0b84a6497a6fa7888aa6fa2f406f86cb6c6b701d /cpp
parentminor fixes (diff)
downloadice-5e75e520d4080bcf13346de56509c84b4c4b90a6.tar.bz2
ice-5e75e520d4080bcf13346de56509c84b4c4b90a6.tar.xz
ice-5e75e520d4080bcf13346de56509c84b4c4b90a6.zip
minor fixes
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/Ice/Connection.cpp4
-rw-r--r--cpp/src/Ice/ConnectionFactory.cpp2
-rw-r--r--cpp/test/Ice/facets/AllTests.cpp11
3 files changed, 10 insertions, 7 deletions
diff --git a/cpp/src/Ice/Connection.cpp b/cpp/src/Ice/Connection.cpp
index 56c5aebca18..a665ebcefef 100644
--- a/cpp/src/Ice/Connection.cpp
+++ b/cpp/src/Ice/Connection.cpp
@@ -434,7 +434,7 @@ IceInternal::Connection::prepareBatchRequest(BasicStream* os)
//
// Give the batch stream to the caller, until finishBatchRequest()
- // is called.
+ // or abortBatchRequest() is called.
//
_batchStream.swap(*os);
}
@@ -1072,6 +1072,8 @@ IceInternal::Connection::exception(const LocalException& ex)
string
IceInternal::Connection::toString() const
{
+ IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this);
+ assert(_transceiver);
return _transceiver->toString();
}
diff --git a/cpp/src/Ice/ConnectionFactory.cpp b/cpp/src/Ice/ConnectionFactory.cpp
index 1e79be144c1..628aad18371 100644
--- a/cpp/src/Ice/ConnectionFactory.cpp
+++ b/cpp/src/Ice/ConnectionFactory.cpp
@@ -507,6 +507,8 @@ IceInternal::IncomingConnectionFactory::exception(const LocalException&)
string
IceInternal::IncomingConnectionFactory::toString() const
{
+ ::IceUtil::Monitor< ::IceUtil::Mutex>::Lock sync(*this);
+
if(_transceiver)
{
return _transceiver->toString();
diff --git a/cpp/test/Ice/facets/AllTests.cpp b/cpp/test/Ice/facets/AllTests.cpp
index c879ccbb581..ec8e5d21c84 100644
--- a/cpp/test/Ice/facets/AllTests.cpp
+++ b/cpp/test/Ice/facets/AllTests.cpp
@@ -25,13 +25,14 @@ class EmptyI : virtual public Empty
GPrx
allTests(const Ice::CommunicatorPtr& communicator)
{
- cout << "testing whether adding the same facet twice raises AlreadyRegisteredException... " << flush;
+ cout << "testing facet registration exceptions... " << flush;
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("FacetExceptionTestAdapter");
Ice::ObjectPtr obj = new EmptyI;
adapter->add(obj, Ice::stringToIdentity("d"));
obj->ice_addFacet(obj, "facetABCD");
bool gotException = false;
- try {
+ try
+ {
obj->ice_addFacet(obj, "facetABCD");
}
catch(Ice::AlreadyRegisteredException&)
@@ -39,12 +40,10 @@ allTests(const Ice::CommunicatorPtr& communicator)
gotException = true;
}
test(gotException);
- cout << "ok" << endl;
-
- cout << "testing whether removing a non-existing facet raises NotRegisteredException... " << flush;
obj->ice_removeFacet("facetABCD");
gotException = false;
- try {
+ try
+ {
obj->ice_removeFacet("facetABCD");
}
catch(Ice::NotRegisteredException&)