diff options
author | Richard Hughes <richard@hughsie.com> | 2011-10-20 12:29:22 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2011-10-20 12:29:22 +0100 |
commit | 548335579287495b6dee170913ed0042edf763a0 (patch) | |
tree | 3ee808c5251a84da49df6b6212afa8ad386015af /src | |
parent | 6b919f05b0d07d9bd2b8566263a0075e522f205c (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.c | 11 |
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; |