Reversed order of operations in kill() to make the killing more immediate.

This commit is contained in:
Ryan Williams
2010-03-29 00:35:35 -07:00
parent 5d4d166882
commit 737e2e71ae

View File

@@ -264,6 +264,7 @@ def kill(g, *throw_args):
g.main(just_raise, (), {})
except:
pass
hub.schedule_call_global(0, g.throw, *throw_args)
if getcurrent() is not hub.greenlet:
sleep(0)
# arrange to wake the caller back up immediately
hub.schedule_call_global(0,getcurrent().switch)
g.throw(*throw_args)