summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/AsyncResult.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Ice/AsyncResult.cpp')
-rw-r--r--cpp/src/Ice/AsyncResult.cpp25
1 files changed, 10 insertions, 15 deletions
diff --git a/cpp/src/Ice/AsyncResult.cpp b/cpp/src/Ice/AsyncResult.cpp
index 03abc55e020..dc1b5689339 100644
--- a/cpp/src/Ice/AsyncResult.cpp
+++ b/cpp/src/Ice/AsyncResult.cpp
@@ -420,25 +420,20 @@ AsyncResult::cancel(const Ice::LocalException& ex)
void
AsyncResult::cancelable(const CancellationHandlerPtr& handler)
{
- {
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(_monitor);
- if(!_cancellationException.get())
- {
- _cancellationHandler = handler;
- return;
- }
- }
- handler->asyncRequestCanceled(OutgoingAsyncBasePtr::dynamicCast(this), *_cancellationException.get());
-}
-
-void
-AsyncResult::checkCanceled()
-{
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(_monitor);
if(_cancellationException.get())
{
- _cancellationException->ice_throw();
+ try
+ {
+ _cancellationException->ice_throw();
+ }
+ catch(const Ice::Exception&)
+ {
+ _cancellationException.reset(0);
+ throw;
+ }
}
+ _cancellationHandler = handler;
}
void