From d7608f578d3013ea2967ff787f53c2d9fd98df87 Mon Sep 17 00:00:00 2001 From: t_feng Date: Wed, 12 Feb 2020 18:39:55 +0800 Subject: [PATCH] Remove initThreading method from pyanaconda.threading --- anaconda.spec | 9 ++- ...ing-method-from-pyanaconda-threading.patch | 69 +++++++++++++++++++ 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 backport-Remove-initThreading-method-from-pyanaconda-threading.patch diff --git a/anaconda.spec b/anaconda.spec index c55518d..110d45f 100644 --- a/anaconda.spec +++ b/anaconda.spec @@ -3,7 +3,7 @@ Name: anaconda Version: 29.24.7 -Release: 26 +Release: 27 Summary: Graphical system installer License: GPLv2+ and MIT URL: https://fedoraproject.org/wiki/Anaconda @@ -48,6 +48,7 @@ Patch9030: anaconda-modify-openeuler-in-welcome-to-lowercase.patch Patch9031: bugfix-setup-fail-in-decode.patch Patch9032: anaconda-modify-default-timezone-and-zh_CN_po.patch Patch9033: bugfix-modify-network-hostname-dot-illegal.patch +Patch9034: backport-Remove-initThreading-method-from-pyanaconda-threading.patch BuildRequires: audit-libs-devel libtool gettext-devel >= 0.19.8 gtk3-devel >= 3.22.17 BuildRequires: gtk-doc gtk3-devel-docs >= 3.22.17 glib2-doc gobject-introspection-devel @@ -220,6 +221,12 @@ update-desktop-database &> /dev/null || : %{_datadir}/gtk-doc %changelog +* Wed Feb 12 2020 openEuler Buildteam - 29.24.7-27 +- Type:bugfix +- Id:NA +- SUG:NA +- DESC:Remove initThreading method from pyanaconda.threading + * Thu Feb 06 2020 openEuler Buildteam - 29.24.7-26 - Type:bugfix - Id:NA diff --git a/backport-Remove-initThreading-method-from-pyanaconda-threading.patch b/backport-Remove-initThreading-method-from-pyanaconda-threading.patch new file mode 100644 index 0000000..e07739c --- /dev/null +++ b/backport-Remove-initThreading-method-from-pyanaconda-threading.patch @@ -0,0 +1,69 @@ +From 05bda4c50c9df594a6b266ac74b60478da4c532c Mon Sep 17 00:00:00 2001 +From: fengtao +Date: Wed, 12 Feb 2020 15:52:08 +0800 +Subject: [PATCH] Remove initThreading method from pyanaconda threading + +--- + anaconda.py | 5 +---- + pyanaconda/threading.py | 17 +---------------- + 2 files changed, 2 insertions(+), 20 deletions(-) + +diff --git a/anaconda.py b/anaconda.py +index 14048e7..52c8826 100755 +--- a/anaconda.py ++++ b/anaconda.py +@@ -274,10 +274,7 @@ if __name__ == "__main__": + setup_python_path() + + # init threading before Gtk can do anything and before we start using threads +- # initThreading initializes the threadMgr instance, import it afterwards +- from pyanaconda.threading import initThreading, AnacondaThread, threadMgr +- initThreading() +- ++ from pyanaconda.threading import AnacondaThread, threadMgr + from pyanaconda.core.i18n import _ + + from pyanaconda.addons import collect_addon_paths +diff --git a/pyanaconda/threading.py b/pyanaconda/threading.py +index a86003d..e0ab802 100644 +--- a/pyanaconda/threading.py ++++ b/pyanaconda/threading.py +@@ -44,10 +44,6 @@ class ThreadManager(object): + self._objs_lock = threading.RLock() + self._errors = {} + self._errors_lock = threading.RLock() +- self._main_thread = threading.main_thread() +- +- def set_current_thread_as_main(self): +- self._main_thread = threading.current_thread() + + def __call__(self): + return self +@@ -176,9 +172,7 @@ class ThreadManager(object): + + def in_main_thread(self): + """Return True if it is run in the main thread.""" +- +- cur_thread = threading.current_thread() +- return cur_thread is self._main_thread ++ return threading.current_thread() is threading.main_thread() + + @property + def running(self): +@@ -293,13 +287,4 @@ class AnacondaThread(threading.Thread): + self._target_stopped() + + +-def initThreading(): +- """Set up threading for anaconda's use. This method must be called before +- any GTK or threading code is called, or else threads will only run when +- an event is triggered in the GTK main loop. And IT HAS TO BE CALLED IN +- THE MAIN THREAD. +- """ +- threadMgr.set_current_thread_as_main() +- +- + threadMgr = ThreadManager() +-- +1.8.3.1 +