From a4a13a382525527afeecd18f97e948bd6d0de64c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 17 Apr 2013 01:49:43 +0200 Subject: use g_thread_new() if GLib is recent enough Fixes deprecation warnings. --- src/UpdateGlue.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/UpdateGlue.cxx') diff --git a/src/UpdateGlue.cxx b/src/UpdateGlue.cxx index 664638782..e9906b84a 100644 --- a/src/UpdateGlue.cxx +++ b/src/UpdateGlue.cxx @@ -99,16 +99,19 @@ static void * update_task(void *_path) static void spawn_update_task(const char *path) { - GError *e = NULL; - assert(g_thread_self() == main_task); progress = UPDATE_PROGRESS_RUNNING; modified = false; +#if GLIB_CHECK_VERSION(2,32,0) + update_thr = g_thread_new("updadte", update_task, g_strdup(path)); +#else + GError *e = NULL; update_thr = g_thread_create(update_task, g_strdup(path), TRUE, &e); if (update_thr == NULL) MPD_ERROR("Failed to spawn update task: %s", e->message); +#endif if (++update_task_id > update_task_id_max) update_task_id = 1; -- cgit v1.2.3