summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2014-11-09 19:26:17 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-11-10 09:31:40 +0900
commit1352d0c66744516f2275c960e692be01ff80ee5a (patch)
treeec425511f057b1976c0333b93dc4d6a3b5830ac0
parentb4c8c0d0afaed8006f1480c83408c8555f957673 (diff)
bgp: enable to stop a chile thread by specifying its name
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/services/protocols/bgp/base.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/ryu/services/protocols/bgp/base.py b/ryu/services/protocols/bgp/base.py
index ef175db0..616315f6 100644
--- a/ryu/services/protocols/bgp/base.py
+++ b/ryu/services/protocols/bgp/base.py
@@ -267,14 +267,16 @@ class Activity(object):
if child_activity.started:
child_activity.stop()
- def _stop_child_threads(self):
+ def _stop_child_threads(self, name=None):
"""Stops all threads spawn by this activity.
"""
child_threads = self._child_thread_map.items()
for thread_name, thread in child_threads:
- LOG.debug('%s: Stopping child thread %s' %
- (self.name, thread_name))
- thread.kill()
+ if not name or thread_name is name:
+ LOG.debug('%s: Stopping child thread %s' %
+ (self.name, thread_name))
+ thread.kill()
+ del self._child_thread_map[thread_name]
def _close_asso_sockets(self):
"""Closes all the sockets linked to this activity.