[master] Two patches helping with threading a bit

Vratislav Podzimek vpodzime at redhat.com
Mon Mar 18 11:16:31 UTC 2013


PATCH 1/2 adds a method to the ThreadManager which can be used to determine if
being in the main thread or not. A reference to the current thread is stored
when ThreadManager is being instantiated which means it has to happen in the
main thread. That's why I moved the instantiation to the initThreading function
which is safer than relying on pyanaconda.threads being imported from the
threadMgr for the first time. However if some other module imports
pyanaconda.threads.threadMgr before the initThreads function is called it will
get None. I understand this is far from being ideal, suggestions welcomed.

The new method can be, of course, used also in pyanaconda/exception.py instead
of passing main_thread_id to the handler.

PATCH 2/2 uses the new ability of threadMgr to make our gtk_* decorators safer.

Vratislav Podzimek (2):
  Add method for checking if in main thread to the ThreadManager
  Make our gtk_* decorators safer and more intelligent

 anaconda                                   | 10 ++++---
 pyanaconda/threads.py                      | 22 +++++++++++---
 pyanaconda/ui/gui/__init__.py              |  8 +++---
 pyanaconda/ui/gui/hubs/progress.py         |  4 +--
 pyanaconda/ui/gui/spokes/datetime_spoke.py |  6 ++--
 pyanaconda/ui/gui/spokes/software.py       |  4 +--
 pyanaconda/ui/gui/spokes/source.py         |  4 +--
 pyanaconda/ui/gui/spokes/storage.py        |  4 +--
 pyanaconda/ui/gui/utils.py                 | 46 +++++++++++++++++++-----------
 9 files changed, 68 insertions(+), 40 deletions(-)

-- 
1.7.11.7



More information about the anaconda-patches mailing list