diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/ConnectionI.cpp | 12 | ||||
-rw-r--r-- | cpp/src/Ice/ConnectionI.h | 2 | ||||
-rw-r--r-- | cpp/src/Ice/Reference.cpp | 1 |
3 files changed, 15 insertions, 0 deletions
diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp index 91c97d3ddc5..6ad509be2b0 100644 --- a/cpp/src/Ice/ConnectionI.cpp +++ b/cpp/src/Ice/ConnectionI.cpp @@ -337,6 +337,18 @@ Ice::ConnectionI::isFinished() const } void +Ice::ConnectionI::throwException() const +{ + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + + if(_exception.get()) + { + assert(_state >= StateClosing); + _exception->ice_throw(); + } +} + +void Ice::ConnectionI::waitUntilHolding() const { IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); diff --git a/cpp/src/Ice/ConnectionI.h b/cpp/src/Ice/ConnectionI.h index 8717fea2dd9..c20356e3c73 100644 --- a/cpp/src/Ice/ConnectionI.h +++ b/cpp/src/Ice/ConnectionI.h @@ -57,6 +57,8 @@ public: bool isDestroyed() const; bool isFinished() const; + void throwException() const; // Throws the connection exception if destroyed. + void waitUntilHolding() const; void waitUntilFinished(); // Not const, as this might close the connection upon timeout. diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp index 8418c2f45a4..02d63007d3d 100644 --- a/cpp/src/Ice/Reference.cpp +++ b/cpp/src/Ice/Reference.cpp @@ -572,6 +572,7 @@ IceInternal::FixedReference::getConnection(bool& compress) const ConnectionIPtr connection = filteredConns[0]; assert(connection); + connection->throwException(); // Throw in case our connection is already destroyed. compress = connection->endpoint()->compress(); return connection; |