From 107bb9c248a09ce56bae63dc8c8ddcbd27d0141a Mon Sep 17 00:00:00 2001 From: "Stephen D. Huston" Date: Tue, 13 Jan 2009 22:41:08 +0000 Subject: Move dispatcher code from iocpDispatcher.cpp (no longer needed) to IocpPoller.cpp (run); mirrors migration introduced on Linux side git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@734265 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/Makefile.am | 1 - cpp/src/common.vcproj | 12 +++++-- cpp/src/qpid/sys/windows/IocpDispatcher.cpp | 54 ----------------------------- cpp/src/qpid/sys/windows/IocpPoller.cpp | 18 ++++++++-- 4 files changed, 24 insertions(+), 61 deletions(-) delete mode 100755 cpp/src/qpid/sys/windows/IocpDispatcher.cpp (limited to 'cpp/src') diff --git a/cpp/src/Makefile.am b/cpp/src/Makefile.am index f9ddc232ac..27592f09ed 100644 --- a/cpp/src/Makefile.am +++ b/cpp/src/Makefile.am @@ -38,7 +38,6 @@ windows_dist = \ qpid/sys/windows/Condition.h \ qpid/sys/windows/FileSysDir.cpp \ qpid/sys/windows/IntegerTypes.h \ - qpid/sys/windows/IocpDispatcher.cpp \ qpid/sys/windows/IocpPoller.cpp \ qpid/sys/windows/IOHandle.cpp \ qpid/sys/windows/IoHandlePrivate.h \ diff --git a/cpp/src/common.vcproj b/cpp/src/common.vcproj index b88995987c..8786ed6b03 100644 --- a/cpp/src/common.vcproj +++ b/cpp/src/common.vcproj @@ -929,6 +929,9 @@ + + @@ -942,13 +945,13 @@ RelativePath="qpid\sys\Shlib.cpp"> + RelativePath="qpid\sys\Timer.cpp"> + RelativePath="qpid\sys\windows\AsynchIO.cpp"> + RelativePath="qpid\sys\windows\FileSysDir.cpp"> @@ -1833,6 +1836,9 @@ + + diff --git a/cpp/src/qpid/sys/windows/IocpDispatcher.cpp b/cpp/src/qpid/sys/windows/IocpDispatcher.cpp deleted file mode 100755 index 1a0f6ce927..0000000000 --- a/cpp/src/qpid/sys/windows/IocpDispatcher.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -#include "qpid/sys/Dispatcher.h" - -#include - -namespace qpid { -namespace sys { - -Dispatcher::Dispatcher(Poller::shared_ptr poller0) : - poller(poller0) { -} - -Dispatcher::~Dispatcher() { -} - -void Dispatcher::run() { - do { - Poller::Event event = poller->wait(); - - // Handle shutdown - switch (event.type) { - case Poller::SHUTDOWN: - return; - break; - case Poller::INVALID: // On any type of success or fail completion - break; - default: - // This should be impossible - assert(false); - } - } while (true); -} - -}} diff --git a/cpp/src/qpid/sys/windows/IocpPoller.cpp b/cpp/src/qpid/sys/windows/IocpPoller.cpp index 1e24adfb46..3760c26c00 100755 --- a/cpp/src/qpid/sys/windows/IocpPoller.cpp +++ b/cpp/src/qpid/sys/windows/IocpPoller.cpp @@ -105,9 +105,21 @@ bool Poller::interrupt(PollerHandle&) { } void Poller::run() { - Poller::shared_ptr p(this); - qpid::sys::Dispatcher d(p); - d.run(); + do { + Poller::Event event = this->wait(); + + // Handle shutdown + switch (event.type) { + case Poller::SHUTDOWN: + return; + break; + case Poller::INVALID: // On any type of success or fail completion + break; + default: + // This should be impossible + assert(false); + } + } while (true); } void Poller::addFd(PollerHandle& handle, Direction dir) { -- cgit v1.2.1