summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2016-01-05 11:56:55 +0100
committerBenoit Foucher <benoit@zeroc.com>2016-01-05 11:56:55 +0100
commit22403a2ad0d8921df9f4ec06f2571d251dbae3a6 (patch)
treef221ed8fd97017bc9afe13ac8bad62f1d7dfb5c2 /cpp/src
parentTravis cleanup (diff)
downloadice-22403a2ad0d8921df9f4ec06f2571d251dbae3a6.tar.bz2
ice-22403a2ad0d8921df9f4ec06f2571d251dbae3a6.tar.xz
ice-22403a2ad0d8921df9f4ec06f2571d251dbae3a6.zip
Fixed potential deadlock that could occur with Ice for C++ when using collocation optimization and serialization
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/ThreadPool.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/cpp/src/Ice/ThreadPool.cpp b/cpp/src/Ice/ThreadPool.cpp
index 7ff3f57db4b..5d03c88f4f4 100644
--- a/cpp/src/Ice/ThreadPool.cpp
+++ b/cpp/src/Ice/ThreadPool.cpp
@@ -777,7 +777,7 @@ IceInternal::ThreadPool::run(const EventHandlerThreadPtr& thread)
// If the handler called ioCompleted(), we re-enable the handler in
// case it was disabled and we decrease the number of thread in use.
//
- if(_serialize)
+ if(_serialize && current._handler.get() != _workQueue.get())
{
_selector.enable(current._handler.get(), current.operation);
if(current._handler->_hasMoreData && current._handler->_registered & SocketOperationRead)
@@ -1004,7 +1004,7 @@ IceInternal::ThreadPool::ioCompleted(ThreadPoolCurrent& current)
if(!_destroyed)
{
- if(_serialize)
+ if(_serialize && current._handler.get() != _workQueue.get())
{
_selector.disable(current._handler.get(), current.operation);
@@ -1079,7 +1079,7 @@ IceInternal::ThreadPool::ioCompleted(ThreadPoolCurrent& current)
}
}
- return _serialize;
+ return _serialize && current._handler.get() != _workQueue.get();
}
#if defined(ICE_USE_IOCP) || defined(ICE_OS_WINRT)