Commit Graph

12 Commits

Author SHA1 Message Date
a88c0ffb93 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:47:19 +02:00
Ell
3c03fcbfbb app: add active async-operations counter to the dashboard
Add an "async" field to the dashboard's "misc" group, showing the
number of async operations currently in the "running" state (i.e.,
all those GimpAsync objects for which gimp_async_finish[_full]() or
gimp_async_abort() haven't been called yet).

(cherry picked from commit aa382650a1)
2018-07-04 16:12:22 -04:00
Ell
7740f0f830 app: implement GimpWaitable::try_wait() in GimpAsync 2018-05-29 16:07:48 -04:00
Ell
fd1e5883f8 app: implement GimpWaitable and GimpCancelable in GimpAsync
Have GimpAsync implement the GimpWaitable and GimpCancelable
interfaces, added in the previous two commits, instead of providing
its own public version of the corresponding functions.

Add gimp_async_cancel_and_wait() as a convenience function for both
canceling an async operation, and waiting for it to complete.

Adapt the rest of the code to the change.

(cherry picked from commit e2c56ef407)
2018-05-27 13:18:56 -04:00
Ell
c820764d4f app: code cleanup in GimpAsync
(cherry picked from commit 770634f84e)
2018-05-27 05:56:57 -04:00
Ell
2d19f29200 app: various GimpAsync improvements
Improve the formalism of a GimpAsync object being "sycned"
(previously referred to as the main thread being "synced" with the
async thread), by both providing a gimp_async_is_synced() function,
separate from gimp_async_is_stopped(), and by improving the type
and function descriptions.

Make sure all previously added callbacks have been called after a
call to gimp_async_wait[_until](), even if these functions are
called from within a callback.

(cherry picked from commit a901c3c1f4)
2018-05-26 14:22:32 -04:00
Ell
c96c6802e8 app: add gimp_async_remove_callback()
... which removes a callback previously added through
gimp_async_add_callback().

(cherry picked from commit 85f67e196c)
2018-05-26 14:22:32 -04:00
Ell
89e9c8d9b3 app: add gimp_async_wait_until()
... which is similar to gimp_async_wait(), taking an 'end_time'
parameter, controlling how long to wait for the async operation to
complete.

(cherry picked from commit 68c57548fd)
2018-05-26 11:33:16 -04:00
Ell
3c95928031 app: in GimpIScissorsTool, use sampler object ...
... instead of gegl_buffer_sample()

Ditto.
2018-05-13 19:40:46 -04:00
Ell
16a24ff081 app: various GimpAsync improvements
Code cleanup.

Improve function descriptions.

Improve function precondition checks.

Make sure the main thread is properly synced with the async thread
before calling the completion callbacks in the idle function.

Guarantee that all callbacks are called in FIFO order, even
callbacks added during the execution of other callbacks.
2018-05-13 15:21:28 -04:00
Ell
729240db34 app: improve GimpAsync description 2018-05-12 09:29:11 -04:00
Ell
e1d15feff7 app: add GimpAsync
GimpAsync represents an asynchronous task, running without blocking
the main thread.  It provides functions that allow waiting for
completion, queueing completion callbacks, and requesting
calcelation.  See the code for more details.

The interface and the implementation are intentionally limited for
the time being, to keep things simple, and are geared toward
asynchronous tasks executed on a separate thread (see the next
commit).  The public interface is relatively general, however, and
we may extend the implementation to support other kinds of tasks at
some point, who knows...
2018-05-11 14:01:42 -04:00