From 7fbef057bfd20488333eb02aba9914299a95bf2a Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Tue, 6 Sep 2016 08:15:26 -0400 Subject: [PATCH] core: Add a field to initdata for enabling async idle tasks I'll use this when testing gui album art to enable fetching the artwork. Signed-off-by: Anna Schumaker --- core/core.c | 7 ++++--- include/core/core.h | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/core.c b/core/core.c index 574d3b59..8f813c7c 100644 --- a/core/core.c +++ b/core/core.c @@ -21,10 +21,11 @@ static bool core_defragment(void *data) void core_init(int *argc, char ***argv, struct core_init_data *init) { #ifdef CONFIG_TESTING - idle_init_sync(); -#else - idle_init(); + if (init->idle_async == false) + idle_init_sync(); + else #endif /* CONFIG_TESTING */ + idle_init(); settings_init(); tags_init(); playlist_init(init->playlist_ops); diff --git a/include/core/core.h b/include/core/core.h index 18f848d5..803037cf 100644 --- a/include/core/core.h +++ b/include/core/core.h @@ -9,6 +9,9 @@ struct core_init_data { struct queue_ops *playlist_ops; struct audio_ops *audio_ops; +#ifdef CONFIG_TESTING + bool idle_async; +#endif /* CONFIG_TESTING */ };