aboutsummaryrefslogtreecommitdiffstats
path: root/src/DecoderThread.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-04-17 01:49:43 +0200
committerMax Kellermann <max@duempel.org>2013-04-17 01:49:43 +0200
commita4a13a382525527afeecd18f97e948bd6d0de64c (patch)
tree19af72f5bfb5dc9dae8e82e7ff3c9d99b2c88335 /src/DecoderThread.cxx
parenta28df6123fef2047ec631d13c91156def6f7ab83 (diff)
downloadmpd-a4a13a382525527afeecd18f97e948bd6d0de64c.tar.gz
mpd-a4a13a382525527afeecd18f97e948bd6d0de64c.tar.xz
mpd-a4a13a382525527afeecd18f97e948bd6d0de64c.zip
use g_thread_new() if GLib is recent enough
Fixes deprecation warnings.
Diffstat (limited to 'src/DecoderThread.cxx')
-rw-r--r--src/DecoderThread.cxx7
1 files changed, 5 insertions, 2 deletions
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
}