aboutsummaryrefslogtreecommitdiffstats
path: root/src/player_thread.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-25 13:44:33 +0100
committerMax Kellermann <max@duempel.org>2009-01-25 13:44:33 +0100
commitd628eb3e8bb2b7e9db5ef6f5b907ac2a81afc86a (patch)
tree12b66d20a329dd7a66347ee21e1108c89613f080 /src/player_thread.c
parentac0e799965afef198e3cba1eb11f018cae680ac3 (diff)
downloadmpd-d628eb3e8bb2b7e9db5ef6f5b907ac2a81afc86a.tar.gz
mpd-d628eb3e8bb2b7e9db5ef6f5b907ac2a81afc86a.tar.xz
mpd-d628eb3e8bb2b7e9db5ef6f5b907ac2a81afc86a.zip
player_control: added player_control.thread
player_control.thread contains the handle of the player thread, or NULL if the player thread isn't running.
Diffstat (limited to '')
-rw-r--r--src/player_thread.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/player_thread.c b/src/player_thread.c
index dc263b6ad..c8f4f69f1 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -548,8 +548,10 @@ static gpointer player_task(G_GNUC_UNUSED gpointer arg)
void player_create(void)
{
GError *e = NULL;
- GThread *t;
- if (!(t = g_thread_create(player_task, NULL, FALSE, &e)))
+ assert(pc.thread == NULL);
+
+ pc.thread = g_thread_create(player_task, NULL, true, &e);
+ if (pc.thread == NULL)
g_error("Failed to spawn player task: %s", e->message);
}