diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-11-20 23:05:28 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-11-20 23:05:28 +0000 |
| commit | 5232a6bdc89241ccfb9e7b7782372911c3e86442 (patch) | |
| tree | e51670fa2c9c695e2d17d2180fa1437f8d10e230 /openstack/common/threadgroup.py | |
| parent | 5ec8cfde3b41b4e4df2e5a1ecad46521c1cde94a (diff) | |
| parent | b6d24bbad9493b4318367c23cbab8c4f688a924a (diff) | |
| download | oslo-5232a6bdc89241ccfb9e7b7782372911c3e86442.tar.gz oslo-5232a6bdc89241ccfb9e7b7782372911c3e86442.tar.xz oslo-5232a6bdc89241ccfb9e7b7782372911c3e86442.zip | |
Merge "updating sphinx documentation"
Diffstat (limited to 'openstack/common/threadgroup.py')
| -rw-r--r-- | openstack/common/threadgroup.py | 24 |
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 |
