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



commit 53cf36d270f28ee233de23ed4d8975813c25110a
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.
    
    https://gitlab.gnome.org/GNOME/gnome-photos/merge_requests/84

 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 92012268..7fa272c5 100644
--- a/src/photos-gegl.c
+++ b/src/photos-gegl.c
@@ -601,8 +601,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);
 
@@ -618,6 +616,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]