[master] [PATCH] Release Gdk lock in exception handling

Vratislav Podzimek vpodzime at redhat.com
Fri Oct 12 21:42:16 UTC 2012


Since we add actions to main loop, not releasing lock may lead
to deadlock.

<not-in-commit-msg>
Until we have Martin's patches reworking threading, this is needed to
handle exceptions from 'with gdk_threaded:' blocks.
</not-in-commit-msg>
---
 pyanaconda/exception.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/pyanaconda/exception.py b/pyanaconda/exception.py
index 871c056..4e369d8 100644
--- a/pyanaconda/exception.py
+++ b/pyanaconda/exception.py
@@ -69,7 +69,11 @@ class AnacondaExceptionHandler(ExceptionHandler):
             sys.exit(0)
         else:
             try:
-                from gi.repository import Gtk
+                from gi.repository import Gtk, Gdk
+
+                # Release Gdk lock to prevent deadlocks in cases when
+                # exception appeared in gdk_threaded block
+                Gdk.threads_leave()
 
                 if Gtk.main_level() > 0:
                     # main loop is running, don't crash it by running another one
-- 
1.7.11.4



More information about the anaconda-patches mailing list