commit 08cb96347bd3b9d663ec877f1692f9d591ac85c9 Author: Damian Johnson atagar@torproject.org Date: Fri Oct 18 12:18:35 2013 -0700
Formatting tweaks for _shutdown_daemons()
Monor changes, most notably is that the NO_SPAWN attribute no longer exists so that bit was a no-op. --- arm/starter.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/arm/starter.py b/arm/starter.py index 94bfa6c..c2e0ae1 100644 --- a/arm/starter.py +++ b/arm/starter.py @@ -268,10 +268,8 @@ def _shutdown_daemons(): Stops and joins on worker threads. """
- # prevents further worker threads from being spawned - arm.util.torTools.NO_SPAWN = True - # stops panel daemons + control = arm.controller.getController()
if control: @@ -282,25 +280,26 @@ def _shutdown_daemons(): panel_impl.join()
# joins on stem threads + arm.util.torTools.getConn().close()
# joins on utility daemon threads - this might take a moment since the # internal threadpools being joined might be sleeping
- resourceTrackers = arm.util.sysTools.RESOURCE_TRACKERS.values() - resolver = arm.util.connections.get_resolver() if arm.util.connections.get_resolver().is_alive() else None + resource_trackers = arm.util.sysTools.RESOURCE_TRACKERS.values() + connection_resolver = arm.util.connections.get_resolver() if arm.util.connections.get_resolver().is_alive() else None
- for tracker in resourceTrackers: + for tracker in resource_trackers: tracker.stop()
- if resolver: - resolver.stop() # sets halt flag (returning immediately) + if connection_resolver: + connection_resolver.stop() # sets halt flag (returning immediately)
- for tracker in resourceTrackers: + for tracker in resource_trackers: tracker.join()
- if resolver: - resolver.join() # joins on halted resolver + if connection_resolver: + connection_resolver.join() # joins on halted resolver
def main():
tor-commits@lists.torproject.org