[PATCH] client: drop unused event queue cond and list variables

Olivier Blin olivier.blin at softathome.com
Thu Jul 17 08:16:12 PDT 2014


The wl_event_queue cond variable has been replaced by the wl_display
reader_cond variable (commit 3c7e8bfbb4745315b7bcbf69fa746c3d6718c305).
This cond variable is never waited for anymore, just
signaled/broadcasted, and thus can be safely removed.

The wl_display event_queue_list can be removed as well, since it was
only used to iterate over the event queue list in order to broadcast
the now unused cond.

No regression on queue unit tests.
---
 src/wayland-client.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/src/wayland-client.c b/src/wayland-client.c
index e8aab7e..0471f6a 100644
--- a/src/wayland-client.c
+++ b/src/wayland-client.c
@@ -72,7 +72,6 @@ struct wl_event_queue {
 	struct wl_list link;
 	struct wl_list event_list;
 	struct wl_display *display;
-	pthread_cond_t cond;
 };
 
 struct wl_display {
@@ -84,7 +83,6 @@ struct wl_display {
 	struct wl_map objects;
 	struct wl_event_queue display_queue;
 	struct wl_event_queue default_queue;
-	struct wl_list event_queue_list;
 	pthread_mutex_t mutex;
 
 	int reader_count;
@@ -99,8 +97,6 @@ static int debug_client = 0;
 static void
 display_fatal_error(struct wl_display *display, int error)
 {
-	struct wl_event_queue *iter;
-
 	if (display->last_error)
 		return;
 
@@ -108,9 +104,6 @@ display_fatal_error(struct wl_display *display, int error)
 		error = 1;
 
 	display->last_error = error;
-
-	wl_list_for_each(iter, &display->event_queue_list, link)
-		pthread_cond_broadcast(&iter->cond);
 }
 
 static void
@@ -125,7 +118,6 @@ static void
 wl_event_queue_init(struct wl_event_queue *queue, struct wl_display *display)
 {
 	wl_list_init(&queue->event_list);
-	pthread_cond_init(&queue->cond, NULL);
 	queue->display = display;
 }
 
@@ -140,7 +132,6 @@ wl_event_queue_release(struct wl_event_queue *queue)
 		wl_list_remove(&closure->link);
 		wl_closure_destroy(closure);
 	}
-	pthread_cond_destroy(&queue->cond);
 }
 
 /** Destroy an event queue
@@ -187,10 +178,6 @@ wl_display_create_queue(struct wl_display *display)
 
 	wl_event_queue_init(queue, display);
 
-	pthread_mutex_lock(&display->mutex);
-	wl_list_insert(&display->event_queue_list, &queue->link);
-	pthread_mutex_unlock(&display->mutex);
-
 	return queue;
 }
 
@@ -711,7 +698,6 @@ wl_display_connect_to_fd(int fd)
 	wl_map_init(&display->objects, WL_MAP_CLIENT_SIDE);
 	wl_event_queue_init(&display->default_queue, display);
 	wl_event_queue_init(&display->display_queue, display);
-	wl_list_init(&display->event_queue_list);
 	pthread_mutex_init(&display->mutex, NULL);
 	pthread_cond_init(&display->reader_cond, NULL);
 	display->reader_count = 0;
@@ -972,8 +958,6 @@ queue_event(struct wl_display *display, int len)
 	else
 		queue = proxy->queue;
 
-	if (wl_list_empty(&queue->event_list))
-		pthread_cond_signal(&queue->cond);
 	wl_list_insert(queue->event_list.prev, &closure->link);
 
 	return size;
-- 
1.9.2

-- This message and any attachments herein are confidential, intended solely for the addressees and are SoftAtHome.s ownership. Any unauthorized use or dissemination is prohibited. If you are not the intended addressee of this message, please cancel it immediately and inform the sender.
-- This message and any attachments herein are confidential, intended solely for the addressees and are SoftAtHome.s ownership. Any unauthorized use or dissemination is prohibited. If you are not the intended addressee of this message, please cancel it immediately and inform the sender.


More information about the wayland-devel mailing list