app: allow progressive execution of parallel async operations
In the gimp_parallel_run_async() family of functions, allow the async callback to return without completing the async operation, in which case the callback will be called again, until the operation is either completed, or canceled, in which case it is aborted (previously, returning from the callback without completing the operation would cause it to be aborted.) It is guaranteed that all operations of the same priority will get a chance to run, even if some of them contuinuosly return without completing. This allows potentially time-consuming operations to yield execution in favor of other same-priority operations, and, in particular, of higher-priority operations, to avoid priority inversion. Essentially, this allows a simple form of cooperative multitasking among async operations.
Showing with 130 additions and 88 deletions