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/DecoderThread.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/DecoderThread.cxx') diff --git a/src/DecoderThread.cxx b/src/DecoderThread.cxx index 18bbad6df..fdc900abd 100644 --- a/src/DecoderThread.cxx +++ b/src/DecoderThread.cxx @@ -494,13 +494,16 @@ decoder_task(gpointer arg) void decoder_thread_start(struct decoder_control *dc) { - GError *e = NULL; - assert(dc->thread == NULL); dc->quit = false; +#if GLIB_CHECK_VERSION(2,32,0) + dc->thread = g_thread_new("thread", decoder_task, dc); +#else + GError *e = NULL; dc->thread = g_thread_create(decoder_task, dc, true, &e); if (dc->thread == NULL) MPD_ERROR("Failed to spawn decoder task: %s", e->message); +#endif } -- cgit v1.2.3