Commit 782bd729 authored by Stephan Richter's avatar Stephan Richter

parent 854429d2
...@@ -25,7 +25,7 @@ register_loop_callback() to register interest. When the mainloop ...@@ -25,7 +25,7 @@ register_loop_callback() to register interest. When the mainloop
thread calls loop(), each registered callback will be called with the thread calls loop(), each registered callback will be called with the
socket map as its first argument. socket map as its first argument.
""" """
__version__ = '$Revision: 1.12 $'[11:-2] __version__ = '$Revision: 1.13 $'[11:-2]
import asyncore import asyncore
import select import select
...@@ -150,6 +150,9 @@ def loop(timeout=30.0, use_poll=0, map=None): ...@@ -150,6 +150,9 @@ def loop(timeout=30.0, use_poll=0, map=None):
except that it also triggers ThreadedAsync callback functions except that it also triggers ThreadedAsync callback functions
before starting the loop. before starting the loop.
""" """
global exit_status
exit_status = None
if use_poll: if use_poll:
if hasattr(select, 'poll'): if hasattr(select, 'poll'):
poll_fun = asyncore.poll3 poll_fun = asyncore.poll3
...@@ -162,7 +165,7 @@ def loop(timeout=30.0, use_poll=0, map=None): ...@@ -162,7 +165,7 @@ def loop(timeout=30.0, use_poll=0, map=None):
map = asyncore.socket_map map = asyncore.socket_map
_start_loop(map) _start_loop(map)
while map: while map and exit_status is None:
poll_fun(timeout, map) poll_fun(timeout, map)
_stop_loop() _stop_loop()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment