summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/sys/windows/IocpPoller.cpp
diff options
context:
space:
mode:
authorStephen D. Huston <shuston@apache.org>2012-05-05 20:28:27 +0000
committerStephen D. Huston <shuston@apache.org>2012-05-05 20:28:27 +0000
commit29868a21a13af5ded0bc9920832a05bd7896e68a (patch)
tree3869a8f23492e1e1e42c809ce728b9605ca2522d /cpp/src/qpid/sys/windows/IocpPoller.cpp
parent140ea7c5b14c7b4af024158a373f1818193fefbd (diff)
downloadqpid-python-29868a21a13af5ded0bc9920832a05bd7896e68a.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/qpid@1334487 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys/windows/IocpPoller.cpp')
-rwxr-xr-xcpp/src/qpid/sys/windows/IocpPoller.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/cpp/src/qpid/sys/windows/IocpPoller.cpp b/cpp/src/qpid/sys/windows/IocpPoller.cpp
index 1805dd2cd8..c81cef87b0 100755
--- a/cpp/src/qpid/sys/windows/IocpPoller.cpp
+++ b/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) {