summaryrefslogtreecommitdiffstats
path: root/openstack
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-01-18 06:33:48 +0000
committerGerrit Code Review <review@openstack.org>2013-01-18 06:33:48 +0000
commit9684c65ffe8b81e49d9ef1130b735d46d1ad449c (patch)
tree3c286d5b058f894d4f7639a719afe3d87243c19b /openstack
parent82e86045b50e5b66f5acdaf402f53db229c947eb (diff)
parent943907790ce804df7ba94f523115099bc961a2b4 (diff)
downloadoslo-9684c65ffe8b81e49d9ef1130b735d46d1ad449c.tar.gz
oslo-9684c65ffe8b81e49d9ef1130b735d46d1ad449c.tar.xz
oslo-9684c65ffe8b81e49d9ef1130b735d46d1ad449c.zip
Merge "ThreadGroup remove unused name parameters"
Diffstat (limited to 'openstack')
-rw-r--r--openstack/common/service.py4
-rw-r--r--openstack/common/threadgroup.py8
2 files changed, 5 insertions, 7 deletions
diff --git a/openstack/common/service.py b/openstack/common/service.py
index 6b180aa..48aeb9d 100644
--- a/openstack/common/service.py
+++ b/openstack/common/service.py
@@ -51,7 +51,7 @@ class Launcher(object):
:returns: None
"""
- self._services = threadgroup.ThreadGroup('launcher')
+ self._services = threadgroup.ThreadGroup()
eventlet_backdoor.initialize_if_enabled()
@staticmethod
@@ -310,7 +310,7 @@ class Service(object):
"""Service object for binaries running on hosts."""
def __init__(self, threads=1000):
- self.tg = threadgroup.ThreadGroup('service', threads)
+ self.tg = threadgroup.ThreadGroup(threads)
def start(self):
pass
diff --git a/openstack/common/threadgroup.py b/openstack/common/threadgroup.py
index 1f80fef..a87497f 100644
--- a/openstack/common/threadgroup.py
+++ b/openstack/common/threadgroup.py
@@ -38,8 +38,7 @@ class Thread(object):
:class:`ThreadGroup`. The Thread will notify the :class:`ThreadGroup` when
it has done so it can be removed from the threads list.
"""
- def __init__(self, name, thread, group):
- self.name = name
+ def __init__(self, thread, group):
self.thread = thread
self.thread.link(_thread_done, group=group, thread=self)
@@ -57,8 +56,7 @@ class ThreadGroup(object):
when need be).
* provide an easy API to add timers.
"""
- def __init__(self, name, thread_pool_size=10):
- self.name = name
+ def __init__(self, thread_pool_size=10):
self.pool = greenpool.GreenPool(thread_pool_size)
self.threads = []
self.timers = []
@@ -72,7 +70,7 @@ class ThreadGroup(object):
def add_thread(self, callback, *args, **kwargs):
gt = self.pool.spawn(callback, *args, **kwargs)
- th = Thread(callback.__name__, gt, self)
+ th = Thread(gt, self)
self.threads.append(th)
def thread_done(self, thread):