-From 24b8dccb2f48bc8595d40288106d51d3f4605544 Mon Sep 17 00:00:00 2001
+From bb2bb0a9f3751156d9537d2daa4507c8b1eff459 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= <jorgen.lind@nokia.com>
 Date: Mon, 5 Mar 2012 12:44:37 +0100
-Subject: [PATCH 1/2] Add thread affinity to wayland clients
+Subject: [PATCH] Add thread affinity to wayland clients
 
 This makes it possible to marshal requests from more than 1 thread in
 wayland clients. However, its not possible to run wl_display_iterate
 from other threads than the thread that made the wl_display.
 ---
  src/Makefile.am      |    2 +
- src/wayland-client.c |  109 +++++++++++++++++++++++++++++++++++++++++++++++--
- src/wayland-client.h |    6 +++
- 3 files changed, 112 insertions(+), 5 deletions(-)
+ src/wayland-client.c |  111 +++++++++++++++++++++++++++++++++++++++++++++++---
+ src/wayland-client.h |    7 ++++
+ 3 files changed, 115 insertions(+), 5 deletions(-)
 
 diff --git a/src/Makefile.am b/src/Makefile.am
-index f356b54..9aab9de 100644
+index f93954e..836cb31 100644
 --- a/src/Makefile.am
 +++ b/src/Makefile.am
-@@ -24,6 +24,8 @@ libwayland_server_la_SOURCES =			\
+@@ -27,6 +27,8 @@ libwayland_server_la_SOURCES =			\
  	event-loop.c
  
- libwayland_client_la_LIBADD = $(FFI_LIBS) libwayland-util.la -lrt
+ libwayland_client_la_LIBADD = $(FFI_LIBS) libwayland-util.la -lrt -lm
 +libwayland_client_la_LDFLAGS = -pthread
 +libwayland_client_la_CFLAGS = -pthread
  libwayland_client_la_SOURCES =			\
  	wayland-protocol.c			\
  	wayland-client.c
 diff --git a/src/wayland-client.c b/src/wayland-client.c
-index 498a429..9eb4b25 100644
+index ecedd99..c385bfe 100644
 --- a/src/wayland-client.c
 +++ b/src/wayland-client.c
 @@ -34,6 +34,7 @@

 	len = wl_connection_data(display->connection, mask);
 
 	while (len > 0) {
@@ -526,6 +623,8 @@ wl_display_iterate(struct wl_display *display, uint32_t mask)
 		len -= size;
 	}
 

 #ifdef  __cplusplus
 extern "C" {
 #endif
@@ -98,6 +101,10 @@ wl_display_get_global(struct wl_display *display,
 
 void wl_log_set_handler_client(wl_log_func_t handler);
 
+int wl_display_get_write_notification_fd(struct wl_display *display);
+
+pthread_t wl_display_thread(struct wl_display *display);
+
 #ifdef  __cplusplus
 }
 #endif
-- 
1.7.9.5

