summaryrefslogtreecommitdiff
path: root/py/modules/IcePy/Communicator.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2005-02-15 17:13:58 +0000
committerBenoit Foucher <benoit@zeroc.com>2005-02-15 17:13:58 +0000
commit2bbd87949f33e94dfc4abdcc9a8c3be22327f28d (patch)
treea33982549235069a8536d8b67a924d565a2ac095 /py/modules/IcePy/Communicator.cpp
parentupdate for PHP 5.0.3 (diff)
downloadice-2bbd87949f33e94dfc4abdcc9a8c3be22327f28d.tar.bz2
ice-2bbd87949f33e94dfc4abdcc9a8c3be22327f28d.tar.xz
ice-2bbd87949f33e94dfc4abdcc9a8c3be22327f28d.zip
Fix to handle spurious wakeup
Diffstat (limited to 'py/modules/IcePy/Communicator.cpp')
-rw-r--r--py/modules/IcePy/Communicator.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/py/modules/IcePy/Communicator.cpp b/py/modules/IcePy/Communicator.cpp
index 159a47c6172..4656f8484b2 100644
--- a/py/modules/IcePy/Communicator.cpp
+++ b/py/modules/IcePy/Communicator.cpp
@@ -236,17 +236,20 @@ communicatorWaitForShutdown(CommunicatorObject* self, PyObject* args)
t->start();
}
- bool done;
- {
- AllowThreads allowThreads; // Release Python's global interpreter lock during blocking calls.
- done = (*self->shutdownMonitor).timedWait(IceUtil::Time::milliSeconds(timeout));
- }
-
- if(!done)
- {
- Py_INCREF(Py_False);
- return Py_False;
- }
+ while(!self->shutdown)
+ {
+ bool done;
+ {
+ AllowThreads allowThreads; // Release Python's global interpreter lock during blocking calls.
+ done = (*self->shutdownMonitor).timedWait(IceUtil::Time::milliSeconds(timeout));
+ }
+
+ if(!done)
+ {
+ Py_INCREF(Py_False);
+ return Py_False;
+ }
+ }
}
assert(self->shutdown);