mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 15:36:14 +01:00
Annotate all custom GIO GSource using g_source_set_name
Naming the sources allows easier debugging with e.g. SystemTap probes. https://bugzilla.gnome.org/show_bug.cgi?id=620536
This commit is contained in:
parent
7568bb66f9
commit
d2fe46b476
@ -2401,6 +2401,7 @@ socket_source_new (GSocket *socket,
|
|||||||
condition |= G_IO_HUP | G_IO_ERR;
|
condition |= G_IO_HUP | G_IO_ERR;
|
||||||
|
|
||||||
source = g_source_new (&socket_source_funcs, sizeof (GSocketSource));
|
source = g_source_new (&socket_source_funcs, sizeof (GSocketSource));
|
||||||
|
g_source_set_name (source, "GSocket");
|
||||||
socket_source = (GSocketSource *)source;
|
socket_source = (GSocketSource *)source;
|
||||||
|
|
||||||
socket_source->socket = g_object_ref (socket);
|
socket_source->socket = g_object_ref (socket);
|
||||||
|
@ -500,6 +500,7 @@ g_unix_input_stream_read_async (GInputStream *stream,
|
|||||||
source = _g_fd_source_new (unix_stream->priv->fd,
|
source = _g_fd_source_new (unix_stream->priv->fd,
|
||||||
G_IO_IN,
|
G_IO_IN,
|
||||||
cancellable);
|
cancellable);
|
||||||
|
g_source_set_name (source, "GUnixInputStream");
|
||||||
|
|
||||||
g_source_set_callback (source, (GSourceFunc)read_async_cb, data, g_free);
|
g_source_set_callback (source, (GSourceFunc)read_async_cb, data, g_free);
|
||||||
g_source_attach (source, g_main_context_get_thread_default ());
|
g_source_attach (source, g_main_context_get_thread_default ());
|
||||||
|
@ -487,6 +487,7 @@ g_unix_output_stream_write_async (GOutputStream *stream,
|
|||||||
source = _g_fd_source_new (unix_stream->priv->fd,
|
source = _g_fd_source_new (unix_stream->priv->fd,
|
||||||
G_IO_OUT,
|
G_IO_OUT,
|
||||||
cancellable);
|
cancellable);
|
||||||
|
g_source_set_name (source, "GUnixOutputStream");
|
||||||
|
|
||||||
g_source_set_callback (source, (GSourceFunc)write_async_cb, data, g_free);
|
g_source_set_callback (source, (GSourceFunc)write_async_cb, data, g_free);
|
||||||
g_source_attach (source, g_main_context_get_thread_default ());
|
g_source_attach (source, g_main_context_get_thread_default ());
|
||||||
|
@ -208,6 +208,7 @@ gboolean _ik_startup (void (*cb)(ik_event_t *event))
|
|||||||
g_io_channel_set_flags (inotify_read_ioc, G_IO_FLAG_NONBLOCK, NULL);
|
g_io_channel_set_flags (inotify_read_ioc, G_IO_FLAG_NONBLOCK, NULL);
|
||||||
|
|
||||||
source = g_source_new (&ik_source_funcs, sizeof (GSource));
|
source = g_source_new (&ik_source_funcs, sizeof (GSource));
|
||||||
|
g_source_set_name (source, "GIO Inotify");
|
||||||
g_source_add_poll (source, &ik_poll_fd);
|
g_source_add_poll (source, &ik_poll_fd);
|
||||||
g_source_set_callback (source, ik_read_callback, NULL, NULL);
|
g_source_set_callback (source, ik_read_callback, NULL, NULL);
|
||||||
g_source_attach (source, NULL);
|
g_source_attach (source, NULL);
|
||||||
|
@ -343,6 +343,7 @@ g_io_unix_create_watch (GIOChannel *channel,
|
|||||||
|
|
||||||
|
|
||||||
source = g_source_new (&g_io_watch_funcs, sizeof (GIOUnixWatch));
|
source = g_source_new (&g_io_watch_funcs, sizeof (GIOUnixWatch));
|
||||||
|
g_source_set_name (source, "GIOChannel (Unix)");
|
||||||
watch = (GIOUnixWatch *)source;
|
watch = (GIOUnixWatch *)source;
|
||||||
|
|
||||||
watch->channel = channel;
|
watch->channel = channel;
|
||||||
|
@ -1166,6 +1166,7 @@ g_io_win32_msg_create_watch (GIOChannel *channel,
|
|||||||
GSource *source;
|
GSource *source;
|
||||||
|
|
||||||
source = g_source_new (&g_io_watch_funcs, sizeof (GIOWin32Watch));
|
source = g_source_new (&g_io_watch_funcs, sizeof (GIOWin32Watch));
|
||||||
|
g_source_set_name (source, "GIOChannel (Win32)");
|
||||||
watch = (GIOWin32Watch *)source;
|
watch = (GIOWin32Watch *)source;
|
||||||
|
|
||||||
watch->channel = channel;
|
watch->channel = channel;
|
||||||
|
Loading…
Reference in New Issue
Block a user