diff options
Diffstat (limited to 'cpp/src/Ice/OutgoingAsync.cpp')
-rw-r--r-- | cpp/src/Ice/OutgoingAsync.cpp | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/cpp/src/Ice/OutgoingAsync.cpp b/cpp/src/Ice/OutgoingAsync.cpp index 060f9019e72..40c753fe656 100644 --- a/cpp/src/Ice/OutgoingAsync.cpp +++ b/cpp/src/Ice/OutgoingAsync.cpp @@ -124,8 +124,7 @@ OutgoingAsyncBase::invokeExceptionAsync() }; // - // CommunicatorDestroyedCompleted is the only exception that can propagate directly - // from this method. + // CommunicatorDestroyedException is the only exception that can propagate directly from this method. // _instance->clientThreadPool()->dispatch(new AsynchronousException(_cachedConnection, ICE_SHARED_FROM_THIS)); } @@ -154,8 +153,7 @@ OutgoingAsyncBase::invokeResponseAsync() }; // - // CommunicatorDestroyedCompleted is the only exception that can propagate directly - // from this method. + // CommunicatorDestroyedException is the only exception that can propagate directly from this method. // _instance->clientThreadPool()->dispatch(new AsynchronousResponse(_cachedConnection, ICE_SHARED_FROM_THIS)); } @@ -534,6 +532,37 @@ OutgoingAsyncBase::throwUserException() } } +void +OutgoingAsyncBase::scheduleCallback(const CallbackPtr& cb) +{ + class WorkItem : public DispatchWorkItem + { + public: + + WorkItem(const CallbackPtr& cb) : _cb(cb) {} + + virtual void run() + { + try + { + _cb->run(); + } + catch(...) + { + } + } + + private: + + CallbackPtr _cb; + }; + + // + // CommunicatorDestroyedException is the only exception that can propagate directly from this method. + // + _instance->clientThreadPool()->dispatch(new WorkItem(cb)); +} + #endif void |