summaryrefslogtreecommitdiffstats
path: root/openstack/common/threadgroup.py
diff options
context:
space:
mode:
Diffstat (limited to 'openstack/common/threadgroup.py')
-rw-r--r--openstack/common/threadgroup.py24
1 files changed, 11 insertions, 13 deletions
diff --git a/openstack/common/threadgroup.py b/openstack/common/threadgroup.py
index f6fe50e..27b3c4c 100644
--- a/openstack/common/threadgroup.py
+++ b/openstack/common/threadgroup.py
@@ -27,19 +27,17 @@ LOG = logging.getLogger(__name__)
def _thread_done(gt, *args, **kwargs):
- '''
- Callback function to be passed to GreenThread.link() when we spawn()
- Calls the ThreadGroup to notify if.
- '''
+ """ Callback function to be passed to GreenThread.link() when we spawn()
+ Calls the :class:`ThreadGroup` to notify if.
+
+ """
kwargs['group'].thread_done(kwargs['thread'])
class Thread(object):
- """
- Wrapper around a greenthread, that holds a reference to
- the ThreadGroup. The Thread will notify the ThreadGroup
- when it has done so it can be removed from the threads
- list.
+ """ Wrapper around a greenthread, that holds a reference to the
+ :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
@@ -54,11 +52,11 @@ class Thread(object):
class ThreadGroup(object):
- """
- The point of this class is to:
- - keep track of timers and greenthreads (making it easier to stop them
+ """ The point of the ThreadGroup classis to:
+
+ * keep track of timers and greenthreads (making it easier to stop them
when need be).
- - provide an easy API to add timers.
+ * provide an easy API to add timers.
"""
def __init__(self, name, thread_pool_size=10):
self.name = name