diff options
author | Richard Hughes <richard@hughsie.com> | 2015-02-04 09:26:38 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2015-02-04 09:27:24 +0000 |
commit | 79f6c0733d134e0ca805fddf26f868dcfc0a3146 (patch) | |
tree | 6f5648539c9afbb74702cf8555a0cd94b952b766 /libappstream-builder/asb-context.c | |
parent | ba68a8a3788a7f3ff3945abd03459a1af909ab46 (diff) | |
download | appstream-glib-79f6c0733d134e0ca805fddf26f868dcfc0a3146.tar.gz |
Do not run with a helper thread if --max-threads=1 is used
Diffstat (limited to 'libappstream-builder/asb-context.c')
-rw-r--r-- | libappstream-builder/asb-context.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libappstream-builder/asb-context.c b/libappstream-builder/asb-context.c index f6ea8b4..b5ebeb6 100644 --- a/libappstream-builder/asb-context.c +++ b/libappstream-builder/asb-context.c @@ -1380,9 +1380,14 @@ asb_context_process (AsbContext *ctx, GError **error) asb_task_set_panel (task, priv->panel); g_ptr_array_add (tasks, task); - /* add task to pool */ - if (!g_thread_pool_push (pool, task, error)) - return FALSE; + /* run the task */ + if (priv->max_threads == 1) { + if (!asb_task_process (task, error)) + return FALSE; + } else { + if (!g_thread_pool_push (pool, task, error)) + return FALSE; + } } /* wait for them to finish */ |