gegl:perlin-noise initialization races
On my laptop running
$ GEGL_THREADS=1 tools/gegl-tester --all -p gegl:perlin-noise -d docs/images -o .
produces a different output than
$ GEGL_THREADS=2 tools/gegl-tester --all -p gegl:perlin-noise -d docs/images -o .
The problem is that all threads but the one initializing global data start using global data before initialization's completed.
A possible fix in this case is to rather use g_once_init_enter ()
and g_once_init_leave ()
in
perlin_init ()
than
a global gint set before calling perlin_init ()
https://gitlab.gnome.org/GNOME/gegl/blob/master/operations/common/perlin/perlin.c#L28
https://gitlab.gnome.org/GNOME/gegl/blob/master/operations/common/perlin/perlin.c#L50
https://gitlab.gnome.org/GNOME/gegl/blob/master/operations/common/perlin/perlin.c#L92