api.kill bugfix: the current (killing) greenlet may not get a chance to execute after kill

This commit is contained in:
Denis Bilenko
2008-11-19 12:22:03 +06:00
parent 435e07513e
commit 7691003399

View File

@@ -254,9 +254,9 @@ def spawn(function, *args, **kwds):
greenlib.switch(g, (_spawn_startup, function, args, kwds, t.cancel))
return g
kill = greenlib.kill
def kill(g):
get_hub().schedule_call(0, greenlib.kill, g)
sleep(0)
def call_after(seconds, function, *args, **kwds):
"""Schedule *function* to be called after *seconds* have elapsed.