From 12f8959ad8d0843a55dd309f087dd1f8a5dda88f Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Tue, 11 Aug 2015 10:42:04 +0200 Subject: Fixed ICE-6695, Ice for WinRT hang on Windows 10 --- cpp/src/Ice/ThreadPool.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cpp/src/Ice/ThreadPool.cpp') diff --git a/cpp/src/Ice/ThreadPool.cpp b/cpp/src/Ice/ThreadPool.cpp index f7c25cc20f4..7ff3f57db4b 100644 --- a/cpp/src/Ice/ThreadPool.cpp +++ b/cpp/src/Ice/ThreadPool.cpp @@ -597,7 +597,7 @@ IceInternal::ThreadPool::finish(const EventHandlerPtr& handler, bool closeNow) return closeNow; #else // If there are no pending asynchronous operations, we can call finish on the handler now. - if(!handler->_pending) + if(!(handler->_pending & SocketOperationWaitForClose)) { _workQueue->queue(new FinishedWorkItem(handler, false)); _selector.finish(handler.get()); @@ -1103,7 +1103,7 @@ IceInternal::ThreadPool::startMessage(ThreadPoolCurrent& current) if(!current._handler->finishAsync(current.operation)) // Returns false if the handler is finished. { current._handler->_pending = static_cast(current._handler->_pending & ~current.operation); - if(!current._handler->_pending && current._handler->_finish) + if(!(current._handler->_pending & SocketOperationWaitForClose) && current._handler->_finish) { _workQueue->queue(new FinishedWorkItem(current._handler, false)); _selector.finish(current._handler.get()); @@ -1117,7 +1117,7 @@ IceInternal::ThreadPool::startMessage(ThreadPoolCurrent& current) if(!current._handler->startAsync(current.operation)) { current._handler->_pending = static_cast(current._handler->_pending & ~current.operation); - if(!current._handler->_pending && current._handler->_finish) + if(!(current._handler->_pending & SocketOperationWaitForClose) && current._handler->_finish) { _workQueue->queue(new FinishedWorkItem(current._handler, false)); _selector.finish(current._handler.get()); @@ -1140,7 +1140,7 @@ IceInternal::ThreadPool::startMessage(ThreadPoolCurrent& current) else { current._handler->_pending = static_cast(current._handler->_pending & ~current.operation); - if(!current._handler->_pending && current._handler->_finish) + if(!(current._handler->_pending & SocketOperationWaitForClose) && current._handler->_finish) { _workQueue->queue(new FinishedWorkItem(current._handler, false)); _selector.finish(current._handler.get()); @@ -1170,7 +1170,7 @@ IceInternal::ThreadPool::finishMessage(ThreadPoolCurrent& current) current._handler->_pending = static_cast(current._handler->_pending & ~current.operation); } - if(!current._handler->_pending && current._handler->_finish) + if(!(current._handler->_pending & SocketOperationWaitForClose) && current._handler->_finish) { // There are no more pending async operations, it's time to call finish. _workQueue->queue(new FinishedWorkItem(current._handler, false)); -- cgit v1.2.3