From 7691003399432d6a46dcc9b7d47edbf29a78cb56 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Wed, 19 Nov 2008 12:22:03 +0600 Subject: [PATCH] api.kill bugfix: the current (killing) greenlet may not get a chance to execute after kill --- eventlet/api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eventlet/api.py b/eventlet/api.py index 8227a1d..33280e8 100644 --- a/eventlet/api.py +++ b/eventlet/api.py @@ -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.