mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-02-11 04:28:09 -05:00
client: Keep a list of queues in wl_display
This will allow us to iterate over the queue list in a future patch, for debugging purposes. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
parent
1ab6b693b1
commit
4a1ad79fc8
1 changed files with 7 additions and 0 deletions
|
|
@ -78,6 +78,7 @@ struct wl_event_queue {
|
|||
struct wl_list proxy_list; /**< struct wl_proxy::queue_link */
|
||||
struct wl_display *display;
|
||||
char *name;
|
||||
struct wl_list link; /**< struct wl_display::queue_list */
|
||||
};
|
||||
|
||||
struct wl_display {
|
||||
|
|
@ -103,6 +104,7 @@ struct wl_display {
|
|||
} protocol_error;
|
||||
int fd;
|
||||
struct wl_map objects;
|
||||
struct wl_list queue_list; /**< struct wl_event_queue::link */
|
||||
struct wl_event_queue display_queue;
|
||||
struct wl_event_queue default_queue;
|
||||
pthread_mutex_t mutex;
|
||||
|
|
@ -230,6 +232,8 @@ wl_event_queue_init(struct wl_event_queue *queue,
|
|||
queue->display = display;
|
||||
if (name)
|
||||
queue->name = strdup(name);
|
||||
|
||||
wl_list_insert(&display->queue_list, &queue->link);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -343,6 +347,8 @@ wl_event_queue_release(struct wl_event_queue *queue)
|
|||
wl_list_remove(&closure->link);
|
||||
destroy_queued_closure(closure);
|
||||
}
|
||||
|
||||
wl_list_remove(&queue->link);
|
||||
}
|
||||
|
||||
/** Destroy an event queue
|
||||
|
|
@ -1239,6 +1245,7 @@ wl_display_connect_to_fd(int fd)
|
|||
|
||||
display->fd = fd;
|
||||
wl_map_init(&display->objects, WL_MAP_CLIENT_SIDE);
|
||||
wl_list_init(&display->queue_list);
|
||||
wl_event_queue_init(&display->default_queue, display, "Default Queue");
|
||||
wl_event_queue_init(&display->display_queue, display, "Display Queue");
|
||||
pthread_mutex_init(&display->mutex, NULL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue