From 22403a2ad0d8921df9f4ec06f2571d251dbae3a6 Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Tue, 5 Jan 2016 11:56:55 +0100 Subject: Fixed potential deadlock that could occur with Ice for C++ when using collocation optimization and serialization --- cpp/src/Ice/ThreadPool.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cpp/src/Ice/ThreadPool.cpp') 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) -- cgit v1.2.3