diff options
author | Max Kellermann <max@duempel.org> | 2009-01-25 13:44:27 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-25 13:44:27 +0100 |
commit | ac0e799965afef198e3cba1eb11f018cae680ac3 (patch) | |
tree | d63667b1e2f26a4b1b29d1f2724fae7504a6ed0e /src/decoder_thread.c | |
parent | 2c45224be72e06463ddd48956ecaef61da9dfecb (diff) | |
download | mpd-ac0e799965afef198e3cba1eb11f018cae680ac3.tar.gz mpd-ac0e799965afef198e3cba1eb11f018cae680ac3.tar.xz mpd-ac0e799965afef198e3cba1eb11f018cae680ac3.zip |
decoder_control: added decoder_control.thread
decoder_control.thread contains the handle of the decoder thread, or
NULL if the decoder thread isn't running.
Diffstat (limited to 'src/decoder_thread.c')
-rw-r--r-- | src/decoder_thread.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/decoder_thread.c b/src/decoder_thread.c index 12449237f..97555f44d 100644 --- a/src/decoder_thread.c +++ b/src/decoder_thread.c @@ -258,8 +258,10 @@ static gpointer decoder_task(G_GNUC_UNUSED gpointer arg) void decoder_thread_start(void) { GError *e = NULL; - GThread *t; - if (!(t = g_thread_create(decoder_task, NULL, FALSE, &e))) + assert(dc.thread == NULL); + + dc.thread = g_thread_create(decoder_task, NULL, true, &e); + if (dc.thread == NULL) FATAL("Failed to spawn decoder task: %s\n", e->message); } |