pull in (partial?) upstream fix for deadlocks (#1193742, fdo#84252)

This commit is contained in:
Rex Dieter 2015-06-12 11:44:56 -05:00
parent 8084b5371f
commit d4eb6b8374
2 changed files with 50 additions and 2 deletions

View File

@ -0,0 +1,42 @@
From f85661c3bca97faa72431df92a3867be39a74e23 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com>
Date: Mon, 1 Jun 2015 11:04:18 +0900
Subject: [PATCH 53/53] Call _xcb_wake_up_next_reader from
xcb_wait_for_special_event
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
All functions calling _xcb_conn_wait() must make sure that waiting
readers are woken up when we read a reply or event that they are waiting
for. xcb_wait_for_special_event() did not do so. This adds the missing
call to_xcb_in_wake_up_next_reader().
Fixes deadlock when waiting for a special event and concurrently
processing the display connection queue in another thread.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84252
Tested-by: Thomas Daede <bztdlinux@gmail.com>
Tested-by: Clément Guérin <geecko.dev@free.fr>
Reviewed-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Uli Schlachter <psychon@znc.in>
---
src/xcb_in.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/xcb_in.c b/src/xcb_in.c
index 623a0a8..322bed8 100644
--- a/src/xcb_in.c
+++ b/src/xcb_in.c
@@ -761,6 +761,7 @@ xcb_generic_event_t *xcb_wait_for_special_event(xcb_connection_t *c,
if(!_xcb_conn_wait(c, &se->special_event_cond, 0, 0))
break;
+ _xcb_in_wake_up_next_reader(c);
pthread_mutex_unlock(&c->iolock);
return event;
}
--
1.9.3

View File

@ -2,7 +2,7 @@
Name: libxcb
Version: 1.11
Release: 5%{?dist}
Release: 6%{?dist}
Summary: A C binding to the X11 protocol
License: MIT
URL: http://xcb.freedesktop.org/
@ -15,6 +15,9 @@ Source0: http://xcb.freedesktop.org/dist/%{name}-%{version}.tar.bz2
# the pkgconfig file so libs that link against libxcb know this...
Source1: pthread-stubs.pc.in
## upstream patches (post 1.11 tag commits)
Patch53: 0053-Call-_xcb_wake_up_next_reader-from-xcb_wait_for_spec.patch
BuildRequires: doxygen
BuildRequires: graphviz
BuildRequires: libtool
@ -46,7 +49,7 @@ BuildArch: noarch
The %{name}-doc package contains documentation for the %{name} library.
%prep
%setup -q
%autosetup -p1
%build
sed -i 's/pthread-stubs //' configure.ac
@ -117,6 +120,9 @@ find $RPM_BUILD_ROOT -name '*.la' -delete
%{_pkgdocdir}
%changelog
* Fri Jun 12 2015 Rex Dieter <rdieter@fedoraproject.org> 1.11-6
- pull in (partial?) upstream fix for deadlocks (#1193742, fdo#84252)
* Wed May 20 2015 Rex Dieter <rdieter@fedoraproject.org> - 1.11-5
- fix rpath harder (#1136546)
- %%build: --disable-silent-rules