Author: shuston Date: Sat May 5 20:28:27 2012 New Revision: 1334487 URL: http://svn.apache.org/viewvc?rev=1334487&view=rev Log: Don't go through the IOCP wait if the poller is shut down. Fixes QPID-3982.
Modified: qpid/trunk/qpid/cpp/src/qpid/sys/windows/IocpPoller.cpp Modified: qpid/trunk/qpid/cpp/src/qpid/sys/windows/IocpPoller.cpp URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/windows/IocpPoller.cpp?rev=1334487&r1=1334486&r2=1334487&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/qpid/sys/windows/IocpPoller.cpp (original) +++ qpid/trunk/qpid/cpp/src/qpid/sys/windows/IocpPoller.cpp Sat May 5 20:28:27 2012 @@ -96,6 +96,7 @@ void Poller::shutdown() { // Allow sloppy code to shut us down more than once. if (impl->isShutdown) return; + impl->isShutdown = true; ULONG_PTR key = 1; // Tell wait() it's a shutdown, not I/O PostQueuedCompletionStatus(impl->iocp, 0, key, 0); } @@ -110,7 +111,7 @@ bool Poller::interrupt(PollerHandle&) { } void Poller::run() { - do { + while (!impl->isShutdown) { Poller::Event event = this->wait(); // Handle shutdown @@ -124,7 +125,7 @@ void Poller::run() { // This should be impossible assert(false); } - } while (true); + } } void Poller::monitorHandle(PollerHandle& handle, Direction dir) { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org