diff options
Diffstat (limited to 'cpp/src/Ice/ThreadPool.cpp')
-rw-r--r-- | cpp/src/Ice/ThreadPool.cpp | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/cpp/src/Ice/ThreadPool.cpp b/cpp/src/Ice/ThreadPool.cpp index 0de8b971559..95ca1000e7d 100644 --- a/cpp/src/Ice/ThreadPool.cpp +++ b/cpp/src/Ice/ThreadPool.cpp @@ -345,7 +345,7 @@ IceInternal::ThreadPool::ThreadPool(const InstancePtr& instance, const string& p const_cast<int&>(_priority) = properties->getPropertyAsInt("Ice.ThreadPriority"); } - _workQueue = new ThreadPoolWorkQueue(*this); + _workQueue = ICE_MAKE_SHARED(ThreadPoolWorkQueue, *this); _selector.initialize(_workQueue.get()); if(_instance->traceLevels()->threadPool >= 1) @@ -674,7 +674,11 @@ IceInternal::ThreadPool::run(const EventHandlerThreadPtr& thread) if(_nextHandler != _handlers.end()) { current._ioCompleted = false; +#ifdef ICE_CPP11_MAPPING + current._handler = dynamic_pointer_cast<EventHandler>(_nextHandler->first->shared_from_this()); +#else current._handler = _nextHandler->first; +#endif current.operation = _nextHandler->second; ++_nextHandler; thread->setState(ThreadStateInUseForIO); @@ -726,10 +730,20 @@ IceInternal::ThreadPool::run(const EventHandlerThreadPtr& thread) { current._ioCompleted = false; #ifdef ICE_OS_WINRT +# ifdef ICE_CPP11_MAPPING + current._handler = dynamic_pointer_cast<EventHandler>( + _selector.getNextHandler(current.operation, _threadIdleTime)->shared_from_this()); +# else current._handler = _selector.getNextHandler(current.operation, _threadIdleTime); +# endif #else +# ifdef ICE_CPP11_MAPPING + current._handler = dynamic_pointer_cast<EventHandler>(_selector.getNextHandler(current.operation, + current._count, current._error, _threadIdleTime)->shared_from_this()); +# else current._handler = _selector.getNextHandler(current.operation, current._count, current._error, _threadIdleTime); +# endif #endif } catch(const SelectorTimeoutException&) @@ -776,10 +790,20 @@ IceInternal::ThreadPool::run(const EventHandlerThreadPtr& thread) try { #ifdef ICE_OS_WINRT +# ifdef ICE_CPP11_MAPPING + current._handler = dynamic_pointer_cast<EventHandler>(_selector.getNextHandler( + current.operation, _serverIdleTime)->shared_from_this()); +# else current._handler = _selector.getNextHandler(current.operation, _serverIdleTime); +# endif #else +# ifdef ICE_CPP11_MAPPING + current._handler = dynamic_pointer_cast<EventHandler>(_selector.getNextHandler(current.operation, + current._count, current._error, _serverIdleTime)->shared_from_this()); +# else current._handler = _selector.getNextHandler(current.operation, current._count, current._error, - _serverIdleTime); + _serverIdleTime); +# endif #endif } catch(const SelectorTimeoutException&) |