aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_thread.c
diff options
context:
space:
mode:
authorThomas Jansen <mithi@mithi.net>2008-12-28 22:09:42 +0100
committerThomas Jansen <mithi@mithi.net>2008-12-28 22:09:42 +0100
commit36b8968e36959451c03a7ca8b210d01114a3ee56 (patch)
tree8d9aa789baf8945bcda8e9a7fcfa1602b88b2871 /src/output_thread.c
parent28128dc4e3c0cd581e868404034aba120c8b56c1 (diff)
downloadmpd-36b8968e36959451c03a7ca8b210d01114a3ee56.tar.gz
mpd-36b8968e36959451c03a7ca8b210d01114a3ee56.tar.xz
mpd-36b8968e36959451c03a7ca8b210d01114a3ee56.zip
output: migrate from pthread to glib threads
Diffstat (limited to '')
-rw-r--r--src/output_thread.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/output_thread.c b/src/output_thread.c
index c887828bb..316c4a719 100644
--- a/src/output_thread.c
+++ b/src/output_thread.c
@@ -106,7 +106,7 @@ static void ao_pause(struct audio_output *ao)
}
}
-static void *audio_output_task(void *arg)
+static gpointer audio_output_task(gpointer arg)
{
struct audio_output *ao = arg;
bool ret;
@@ -167,12 +167,10 @@ static void *audio_output_task(void *arg)
void audio_output_thread_start(struct audio_output *ao)
{
- pthread_attr_t attr;
+ GError *e;
assert(ao->command == AO_COMMAND_NONE);
- pthread_attr_init(&attr);
- pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
- if (pthread_create(&ao->thread, &attr, audio_output_task, ao))
- g_error("Failed to spawn output task: %s\n", strerror(errno));
+ if (!(ao->thread = g_thread_create(audio_output_task, ao, FALSE, &e)))
+ g_error("Failed to spawn output task: %s\n", e->message);
}