summaryrefslogtreecommitdiff
path: root/src/glibext/delayed.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-06-04 17:58:34 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-06-04 17:58:48 (GMT)
commit1f2b71e31326a5bc021785888cd2203010acf4e6 (patch)
treeb82fd64f1137a09553aa2cb513f974e1308e3022 /src/glibext/delayed.c
parenta7f73441a0d466824798a421f369628db0184030 (diff)
Defined the number of threads to run from a centralized function.
Diffstat (limited to 'src/glibext/delayed.c')
-rw-r--r--src/glibext/delayed.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/glibext/delayed.c b/src/glibext/delayed.c
index caffbaa..6e81c4b 100644
--- a/src/glibext/delayed.c
+++ b/src/glibext/delayed.c
@@ -32,6 +32,7 @@
#include "delayed-int.h"
+#include "../core/nproc.h"
#include "../gui/core/global.h"
@@ -396,7 +397,7 @@ static void g_work_group_init(GWorkGroup *group)
g_atomic_int_set(&group->pending, 0);
group->threads = NULL;
- group->threads_count = g_get_num_processors();
+ group->threads_count = 0;
group->force_exit = false;
group->callback = NULL;
@@ -501,7 +502,7 @@ static GWorkGroup *g_work_group_new(wgroup_id_t id, const guint *count)
result->id = id;
- result->threads_count = g_get_num_processors();
+ result->threads_count = get_max_online_threads();
if (count != NULL && *count < result->threads_count)
result->threads_count = *count;