summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/ThreadPool.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2016-08-04 16:52:11 -0400
committerBernard Normier <bernard@zeroc.com>2016-08-04 16:52:11 -0400
commit124017bfb9469d9c081c92acee12b4eac9304758 (patch)
treee66cf548380f8d722cefd68fb26eae399e08b9d1 /cpp/src/Ice/ThreadPool.cpp
parentUpdate UWP test certificate (diff)
downloadice-124017bfb9469d9c081c92acee12b4eac9304758.tar.bz2
ice-124017bfb9469d9c081c92acee12b4eac9304758.tar.xz
ice-124017bfb9469d9c081c92acee12b4eac9304758.zip
Refactored shared_from_this/enable_shared_from_this
Diffstat (limited to 'cpp/src/Ice/ThreadPool.cpp')
-rw-r--r--cpp/src/Ice/ThreadPool.cpp39
1 files changed, 8 insertions, 31 deletions
diff --git a/cpp/src/Ice/ThreadPool.cpp b/cpp/src/Ice/ThreadPool.cpp
index 4e9a5735835..87e3db78a23 100644
--- a/cpp/src/Ice/ThreadPool.cpp
+++ b/cpp/src/Ice/ThreadPool.cpp
@@ -692,11 +692,7 @@ 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._handler = ICE_GET_SHARED_FROM_THIS(_nextHandler->first);
current.operation = _nextHandler->second;
++_nextHandler;
thread->setState(ThreadStateInUseForIO);
@@ -748,20 +744,10 @@ 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
+ current._handler = ICE_GET_SHARED_FROM_THIS(_selector.getNextHandler(current.operation, _threadIdleTime));
#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
+ current._handler = ICE_GET_SHARED_FROM_THIS(_selector.getNextHandler(current.operation, current._count, current._error,
+ _threadIdleTime));
#endif
}
catch(const SelectorTimeoutException&)
@@ -808,20 +794,11 @@ 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
+ current._handler = ICE_GET_SHARED_FROM_THIS(_selector.getNextHandler(current.operation, _serverIdleTime));
#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);
-# endif
+
+ current._handler = ICE_GET_SHARED_FROM_THIS(_selector.getNextHandler(current.operation, current._count,
+ current._error, _serverIdleTime));
#endif
}
catch(const SelectorTimeoutException&)