use g_thread_new() if GLib is recent enough

Fixes deprecation warnings.
This commit is contained in:
Max Kellermann
2013-04-17 01:49:43 +02:00
parent a28df6123f
commit a4a13a3825
5 changed files with 26 additions and 9 deletions

View File

@@ -1202,8 +1202,12 @@ player_create(struct player_control *pc)
{
assert(pc->thread == NULL);
#if GLIB_CHECK_VERSION(2,32,0)
pc->thread = g_thread_new("player", player_task, pc);
#else
GError *e = NULL;
pc->thread = g_thread_create(player_task, pc, true, &e);
if (pc->thread == NULL)
MPD_ERROR("Failed to spawn player task: %s", e->message);
#endif
}