* Add `vips_semaphore_down_timeout` to public API
In preparation for the next commit.
* threadset: stop idle threads after a regular timeout
In line with the previous behaviour of GLib's threadpool.
* threadset: fix a small memory leak
* threadset: ensure idle threads are freed on exit
GLib threads are spawned with `ref_count == 2`, this reference is
decreased during thread exit and associated resources are freed
during `g_thread_join()`. However, idle threads that are stopped
after a regular timeout are not joined. To fix this, decrease the
reference count during `vips_threadset_add()` and increase it just
before joining the thread with `g_thread_join()`.
See:
2d5d990c6a/glib/gthread.c (L522)2d5d990c6a/glib/gthread-posix.c (L1287)
* Deprecate `vips_g_thread_join()` in favor of `g_thread_join()`
* nit: remove extra semicolon
Use GLib's i18n support instead of copying and pasting that
logic into its own header. This deprecates the vips/intl.h
header in favour of glib/gi18n.h.
remove shutdown from atexit
Because atexit() can be called at almost any point during process termination,
including after worker threads have been force-quit, we can't use it for
cleanup.
New policy: use vips_shutdown() explicitly if you need to clean up,
though it's optional. Only use atexit() for leak checking.
Since threads on Windows can be terminated prior to the execution
of the atexit registered functions (i.e. vips_shutdown), causing
a surprising deadlock. This thread is never recycled, so it should
be fine.
Reverts commit d1b4d12388 partially.
We had two API calls, vips_image_copy_fields() and vips_demand_hint().
They are now combined in the single vips_image_pipeline() call.
All operations are now slightly smaller and simpler.
glib-2.32 deprecated g_mutex_new() ... use a compat function to hide
this change
also remove the --without-threads configure flag, gthread is now
compulsory, so there was no longer any point
generate now has a 'stop' param, set this to indicate early successful
termination
this will be used by VipsMin and friends to stop scanning early for
conditions like seen a 0 in a uchar image while searching for min
floating refs were very confusing and annoying, instead use simple fixed
refs and add a pool system to track refs for you
also fixed a couple of dumb errors in close callbacks