[pygtk2/f14/master] Fix 100% CPU usage issue in pygtk_main_watch_check

Christopher Aillon caillon at fedoraproject.org
Tue Apr 12 18:11:06 UTC 2011


commit be137012d354b900d8229ef2015c4863ffe6f1f0
Author: Christopher Aillon <caillon at redhat.com>
Date:   Tue Apr 12 11:06:10 2011 -0700

    Fix 100% CPU usage issue in pygtk_main_watch_check
    
    https://bugzilla.gnome.org/show_bug.cgi?id=640738
    https://bugzilla.gnome.org/show_bug.cgi?id=638780
    https://bugzilla.redhat.com/show_bug.cgi?id=660137

 ...ain_watch_check-copied-from-pygobject-gli.patch |   27 ++++++++++++++++++++
 pygtk2.spec                                        |    5 +++
 2 files changed, 32 insertions(+), 0 deletions(-)
---
diff --git a/0002-Fix-pygtk_main_watch_check-copied-from-pygobject-gli.patch b/0002-Fix-pygtk_main_watch_check-copied-from-pygobject-gli.patch
new file mode 100644
index 0000000..d42d023
--- /dev/null
+++ b/0002-Fix-pygtk_main_watch_check-copied-from-pygobject-gli.patch
@@ -0,0 +1,27 @@
+From 4cbd3c031289775f365c247f949d91facac4ba82 Mon Sep 17 00:00:00 2001
+From: Dieter Verfaillie <dieterv at optionexplicit.be>
+Date: Thu, 03 Feb 2011 12:44:10 +0000
+Subject: Fix pygtk_main_watch_check, copied from pygobject/glib/pygmainloop.c:pyg_signal_watch_check.
+
+Fixes bug 640738 and 638780.
+---
+diff --git a/gtk/gtk.override b/gtk/gtk.override
+index 75018f4..94309a6 100644
+--- a/gtk/gtk.override
++++ b/gtk/gtk.override
+@@ -1151,9 +1151,10 @@ pygtk_main_watch_check(GSource *source)
+ #ifdef HAVE_PYSIGNAL_SETWAKEUPFD
+     PySignalWatchSource *real_source = (PySignalWatchSource *)source;
+     GPollFD *poll_fd = &real_source->fd;
+-    int data_size = 0;
++    unsigned char dummy;
++    gssize ret;
+     if (poll_fd->revents & G_IO_IN)
+-        data_size = read(poll_fd->fd, 0, 1);
++        ret = read(poll_fd->fd, &dummy, 1);
+ #endif
+ 
+     state = pyg_gil_state_ensure();
+--
+cgit v0.9
+
diff --git a/pygtk2.spec b/pygtk2.spec
index c6939ec..2bf650d 100644
--- a/pygtk2.spec
+++ b/pygtk2.spec
@@ -38,6 +38,10 @@ Patch2: 0001-pygtk-2.0.pc-Should-require-gtk-2.0.patch
 # http://git.gnome.org/browse/pygtk/commit/?id=f4cc1453896a891b8197a4ddbc1b7b9706c86996
 Patch3: 0001-gtk_main-fixed-use-of-Python-s-SetWakeupFD-API.patch
 
+# http://git.gnome.org/browse/pygtk/commit/?id=4cbd3c031289775f365c247f949d91facac4ba82
+# RH bug: https://bugzilla.redhat.com/show_bug.cgi?id=660137
+Patch4: 0002-Fix-pygtk_main_watch_check-copied-from-pygobject-gli.patch
+
 ### Dependencies ###
 
 # Leave these requirements alone!  RPM isn't smart enough
@@ -111,6 +115,7 @@ This package contains documentation files for %{name}.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 
 %build
 %configure --enable-thread --enable-numpy


More information about the scm-commits mailing list