summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2011-10-20 12:29:22 +0100
committerRichard Hughes <richard@hughsie.com>2011-10-20 12:29:22 +0100
commit548335579287495b6dee170913ed0042edf763a0 (patch)
tree3ee808c5251a84da49df6b6212afa8ad386015af /src
parent6b919f05b0d07d9bd2b8566263a0075e522f205c (diff)
Use the new g_thread_new() for new versions of GLib
This gives us the thread name in gdb.
Diffstat (limited to 'src')
-rw-r--r--src/pk-backend.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/pk-backend.c b/src/pk-backend.c
index 0e540d72..a931e7f1 100644
--- a/src/pk-backend.c
+++ b/src/pk-backend.c
@@ -2676,7 +2676,16 @@ pk_backend_thread_create (PkBackend *backend, PkBackendThreadFunc func)
helper->func = func;
/* create a thread */
- backend->priv->thread = g_thread_create (pk_backend_thread_setup, helper, FALSE, NULL);
+#if GLIB_CHECK_VERSION(2,31,0)
+ backend->priv->thread = g_thread_new ("PK-Backend",
+ pk_backend_thread_setup,
+ helper);
+#else
+ backend->priv->thread = g_thread_create (pk_backend_thread_setup,
+ helper,
+ FALSE,
+ NULL);
+#endif
if (backend->priv->thread == NULL) {
g_warning ("failed to create thread");
ret = FALSE;