Merge branch '8.11'

This commit is contained in:
John Cupitt 2021-07-16 10:23:19 +01:00
commit b493b16e54
2 changed files with 27 additions and 7 deletions

View File

@ -2,12 +2,15 @@
- all tools support `--version`
- add vips_svgload_string() convenience function
14/8/20 started 8.11.2
14/7/21 started 8.11.3
- build threadpool later [kleisauke]
15/6/20 started 8.11.2
- better libdir guessing [remi]
- fix tiff pyramid creation with jp2k compression (was broken by 8.11.1)
- don't load modules if we're built without modules
14/8/20 started 8.11.1
18/6/21 started 8.11.1
- add more example code to C docs
- update libtool support in configure.ac
- more startup info if VIPS_INFO is set

View File

@ -731,6 +731,19 @@ vips_task_free( VipsTask *task )
VIPS_FREE( task );
}
static void *
vips__thread_once_init( void *data )
{
/* We can have many more than vips__concurrency threads -- each active
* pipeline will make vips__concurrency more, see
* vips_threadpool_run().
*/
vips__pool = g_thread_pool_new( vips_thread_main_loop, NULL,
-1, FALSE, NULL );
return( NULL );
}
/**
* vips__thread_execute:
* @name: a name for the thread
@ -747,10 +760,14 @@ vips_task_free( VipsTask *task )
int
vips__thread_execute( const char *name, GFunc func, gpointer data )
{
static GOnce once = G_ONCE_INIT;
VipsThreadExec *exec;
GError *error = NULL;
gboolean result;
VIPS_ONCE( &once, vips__thread_once_init, NULL );
exec = g_new( VipsThreadExec, 1 );
exec->name = name;
exec->func = func;
@ -948,12 +965,12 @@ vips__threadpool_init( void )
if( vips__concurrency == 0 )
vips__concurrency = vips__concurrency_get_default();
/* We can have many more than vips__concurrency threads -- each active
* pipeline will make vips__concurrency more, see
* vips_threadpool_run().
/* The threadpool is built in the first vips__thread_execute()
* call, since we want thread creation to happen as late as possible.
*
* Many web platforms start up in a base environment, then fork() for
* each request. We must not make the threadpool before the fork.
*/
vips__pool = g_thread_pool_new( vips_thread_main_loop, NULL,
-1, FALSE, NULL );
VIPS_DEBUG_MSG( "vips__threadpool_init: (%p)\n", vips__pool );
}