[gnome-photos/wip/rishi/unit-tests-gegl: 3/5] gegl: Allow overriding the number of threads



commit 43d7936109d4ef933c3081c94ec3d0a82b0d79df
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed Nov 21 00:07:13 2018 +0100

    gegl: Allow overriding the number of threads
    
    A subsequent commit will use gegl:path to create images that will be
    used as input data for testing. It turns out that, for hitherto
    unknown reasons, using multiple threads causes minor disturbances in
    gegl:path's output which interferes with the tests. Therefore, it is
    useful to override the number of threads used by GEGL for affected
    tests where the multi-threading isn't part of the code that is being
    tested.
    
    Since gegl_init reads the GEGL_THREADS environment variable, it has to
    be called later so that it can override the default GEGL
    configuration.

 src/photos-gegl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-gegl.c b/src/photos-gegl.c
index 7788b758..27a29d54 100644
--- a/src/photos-gegl.c
+++ b/src/photos-gegl.c
@@ -606,8 +606,6 @@ photos_gegl_init (void)
   gint threads;
   guint n_processors;
 
-  gegl_init (NULL, NULL);
-
   n_processors = g_get_num_processors ();
   g_return_if_fail (n_processors > 0);
 
@@ -623,6 +621,8 @@ photos_gegl_init (void)
   g_object_set (config, "application-license", "GPL3", NULL);
   g_object_set (config, "threads", threads, NULL);
   g_object_set (config, "use-opencl", FALSE, NULL);
+
+  gegl_init (NULL, NULL);
 }
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]