fakessh: interruptible wait compatible with <2.7; closes #55

pull/59/head
David Wilson 7 years ago
parent dacc57ba5f
commit 325f5323a5

@ -160,8 +160,12 @@ class Process(object):
self.router.broker.start_receive(self.pump)
def wait(self):
while not self.wake_event.wait(0.1):
pass
while not self.wake_event.isSet():
# Timeout is used so that sleep is interruptible, as blocking
# variants of libc thread operations cannot be interrupted e.g. via
# KeyboardInterrupt. isSet() test and wait() are separate since in
# <2.7 wait() always returns None.
self.wake_event.wait(0.1):
@mitogen.core.takes_router

Loading…
Cancel
Save