aboutsummaryrefslogtreecommitdiff
path: root/include/glib-compat.h
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2016-09-30 11:50:18 +0100
committerDaniel P. Berrange <berrange@redhat.com>2016-10-27 09:13:10 +0200
commit20f4aa265ec8442be66f00ee3986a92018b44b7b (patch)
tree96a7f441c86c1c286f083571ab7dc27160b068f1 /include/glib-compat.h
parentaf8096b2c3b16de3f6237f1ead6a657a7565272f (diff)
io: add ability to set a name for IO channels
The GSource object has ability to have a name, which is useful when debugging performance problems with the mainloop event callbacks that take too long. By associating a name with a QIOChannel object, we can then set the name on any GSource associated with the channel. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'include/glib-compat.h')
-rw-r--r--include/glib-compat.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/glib-compat.h b/include/glib-compat.h
index 8093163bee..9dfe952c5d 100644
--- a/include/glib-compat.h
+++ b/include/glib-compat.h
@@ -304,4 +304,11 @@ static inline void g_slist_free_full(GSList *list, GDestroyNotify free_func)
}
#endif
+#if !GLIB_CHECK_VERSION(2, 26, 0)
+static inline void g_source_set_name(GSource *source, const char *name)
+{
+ /* This is just a debugging aid, so leaving it a no-op */
+}
+#endif
+
#endif