diff options
author | Stephen D. Huston <shuston@apache.org> | 2012-05-05 20:28:27 +0000 |
---|---|---|
committer | Stephen D. Huston <shuston@apache.org> | 2012-05-05 20:28:27 +0000 |
commit | ade0c939b4b3c2d9d1c2be57e4fb75888da6152f (patch) | |
tree | 76aaa2253990e4288e216e7ac156b6b14b508c82 | |
parent | c213351b491f438f4488879ed67b9718c0a52d10 (diff) | |
download | qpid-python-ade0c939b4b3c2d9d1c2be57e4fb75888da6152f.tar.gz |
Don't go through the IOCP wait if the poller is shut down. Fixes QPID-3982.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1334487 13f79535-47bb-0310-9956-ffa450edef68
-rwxr-xr-x | qpid/cpp/src/qpid/sys/windows/IocpPoller.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/qpid/cpp/src/qpid/sys/windows/IocpPoller.cpp b/qpid/cpp/src/qpid/sys/windows/IocpPoller.cpp index 1805dd2cd8..c81cef87b0 100755 --- a/qpid/cpp/src/qpid/sys/windows/IocpPoller.cpp +++ b/qpid/cpp/src/qpid/sys/windows/IocpPoller.cpp @@ -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) { |