diff options
author | Max Kellermann <max@duempel.org> | 2013-10-17 18:42:14 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-17 19:29:47 +0200 |
commit | 8e676db633aa8888c8408a91ef219d2261ef42e2 (patch) | |
tree | 9e61e37ab5d181e90e89c5d4ced99c3434b3976c /src/OutputThread.cxx | |
parent | f6d74012b7a583bddf2e3b824193ade91fe09ce7 (diff) | |
download | mpd-8e676db633aa8888c8408a91ef219d2261ef42e2.tar.gz mpd-8e676db633aa8888c8408a91ef219d2261ef42e2.tar.xz mpd-8e676db633aa8888c8408a91ef219d2261ef42e2.zip |
Thread/Thread: replacement library for GThread
Diffstat (limited to '')
-rw-r--r-- | src/OutputThread.cxx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/OutputThread.cxx b/src/OutputThread.cxx index a3a842df4..5b93b04e3 100644 --- a/src/OutputThread.cxx +++ b/src/OutputThread.cxx @@ -562,7 +562,8 @@ static void ao_pause(struct audio_output *ao) ao->pause = false; } -static gpointer audio_output_task(gpointer arg) +static void +audio_output_task(void *arg) { struct audio_output *ao = (struct audio_output *)arg; @@ -647,7 +648,7 @@ static gpointer audio_output_task(gpointer arg) ao->chunk = NULL; ao_command_finished(ao); ao->mutex.unlock(); - return NULL; + return; } if (ao->open && ao->allow_play && ao_play(ao)) @@ -664,11 +665,7 @@ void audio_output_thread_start(struct audio_output *ao) { assert(ao->command == AO_COMMAND_NONE); -#if GLIB_CHECK_VERSION(2,32,0) - ao->thread = g_thread_new("output", audio_output_task, ao); -#else - GError *e = nullptr; - if (!(ao->thread = g_thread_create(audio_output_task, ao, true, &e))) - FatalError("Failed to spawn output task", e); -#endif + Error error; + if (!ao->thread.Start(audio_output_task, ao, error)) + FatalError(error); } |