summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-11-19 14:17:42 +0100
committerVictor Stinner <victor.stinner@gmail.com>2014-11-19 14:17:42 +0100
commit5c16da690baddcf8e3fddf8aa789b68577f74332 (patch)
tree1432c6554bf82290593b7b5bd0e0524e58adf42b
parent5b93178ab50eb1047ee83111dc131707852d2156 (diff)
downloadaioeventlet-5c16da690baddcf8e3fddf8aa789b68577f74332.tar.gz
run_forever(): first ensure that _run_once() will not be called
-rw-r--r--aiogreen.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/aiogreen.py b/aiogreen.py
index 5a00043..77bb0d9 100644
--- a/aiogreen.py
+++ b/aiogreen.py
@@ -354,8 +354,12 @@ class EventLoop(BaseEventLoop):
# sleep until the stop() method is called
stop_event.wait()
finally:
- self._stop_event = None
+ # First ensure that _run_once() will not be called
self._scheduler.stop()
+
+ # The event loop stopped
+ self._stop_event = None
+
# Stop the greenthread of the thread queue.
# call_soon_threadsafe() can still be called, handles will be
# stored in the thread queue.