Skip to content
  • Ell's avatar
    app: flush async-operations queue when setting async thread count to 0 · 432a8847
    Ell authored
    In gimp-parallel, always flush the async-operations queue (by
    executing all remaining operations on the caller thread) when
    setting the async-pool thread count to 0 (as happens when setting
    GEGL_THREADS=1, per the previous commit,) and not only when
    shutting GIMP down.  Otherwise, pending asynchronous operations
    can "get lost" when setting GEGL_THREADS to 1.
    
    Additionally, in gimp_gegl_init(), initialize gimp-parallel before
    before connecting to GimpGeglConfig's "notify::num-processors"
    signal, so that the number of async threads is set *before*
    GEGL_THREADS, in order to avoid setting GEGL_THREADS to 1 while
    async operations are still executing.
    
    Also, allow setting the number of gimp-parallel-distribute threads
    while a gimp-parallel-distribute function is running (which can
    happen if gimp-parallel-distribute is used in an async operation,
    as is the case for histogram calculation), by waiting for the
    parallel-distribute function to finish before setting the number of
    threads.
    432a8847