Commit 129ae841 authored by Denis Bilenko's avatar Denis Bilenko

don't ignore timeout parameter in joinall()

parent 1586dcdc
...@@ -405,17 +405,21 @@ def joinall(greenlets, timeout=None, raise_error=False): ...@@ -405,17 +405,21 @@ def joinall(greenlets, timeout=None, raise_error=False):
from gevent.queue import Queue from gevent.queue import Queue
queue = Queue() queue = Queue()
put = queue.put put = queue.put
timeout = Timeout(timeout)
try: try:
for greenlet in greenlets: try:
greenlet.rawlink(put) for greenlet in greenlets:
for _ in xrange(len(greenlets)): greenlet.rawlink(put)
greenlet = queue.get() for _ in xrange(len(greenlets)):
if raise_error and not greenlet.successful(): greenlet = queue.get()
getcurrent().throw(greenlet.exception) if raise_error and not greenlet.successful():
except: getcurrent().throw(greenlet.exception)
for greenlet in greenlets: except:
greenlet.unlink(put) for greenlet in greenlets:
raise greenlet.unlink(put)
raise
finally:
timeout.cancel()
def _killall3(greenlets, exception, waiter): def _killall3(greenlets, exception, waiter):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment