summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/ThreadPool.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2015-12-01 17:36:19 +0100
committerJose <jose@zeroc.com>2015-12-01 17:36:19 +0100
commit2029ff368e49fae489b8ec8fc12f7d126b182dfb (patch)
tree6075d652b7851831c39e6f22004d8720864f1a60 /cpp/src/Ice/ThreadPool.cpp
parentThe default LMDB map size for IceGrid and IceStorm is now 10MB (Windows) (diff)
downloadice-2029ff368e49fae489b8ec8fc12f7d126b182dfb.tar.bz2
ice-2029ff368e49fae489b8ec8fc12f7d126b182dfb.tar.xz
ice-2029ff368e49fae489b8ec8fc12f7d126b182dfb.zip
C++11 mapping initial commit
Diffstat (limited to 'cpp/src/Ice/ThreadPool.cpp')
-rw-r--r--cpp/src/Ice/ThreadPool.cpp28
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&)