def killall(greenlets, exception=GreenletExit, block=True, timeout=None):
 greenlets = list(greenlets)
 if (not greenlets):
  return
 loop = greenlets[0].loop
 if block:
  waiter = Waiter()
  loop.run_callback(_killall3, greenlets, exception, waiter)
  t = Timeout._start_new_or_dummy(timeout)
  try:
   alive = waiter.get()
   if alive:
    joinall(alive, raise_error=False)
  finally:
   t.cancel()
 else:
  loop.run_callback(_killall, greenlets, exception)

def killall ( greenlets , exception = GreenletExit , block = True , timeout = None ) : greenlets = list ( greenlets ) if ( not greenlets ) : return loop = greenlets [ 0 ] . loop if block : waiter = Waiter ( ) loop . run_callback ( _killall3 , greenlets , exception , waiter ) t = Timeout . _start_new_or_dummy ( timeout ) try : alive = waiter . get ( ) if alive : joinall ( alive , raise_error = False ) finally : t . cancel ( ) else : loop . run_callback ( _killall , greenlets , exception )
forceably terminate all the greenlets by causing them to raise exception .