tweak docs, add changelog notes

and an assert for semaphore_down_timeout

see https://github.com/libvips/libvips/pull/3253
This commit is contained in:
John Cupitt 2023-01-03 12:09:24 +00:00
parent 848a119faa
commit e2c2866fc6
5 changed files with 22 additions and 16 deletions

View File

@ -1,6 +1,9 @@
xx/1/23 8.14.1
- add vips_thread_isworker() compatibility function [remicollet]
- add vips_semaphore_down_timeout() [kleisauke]
- idle threads are removed after 15s [kleisauke]
- fix version number in gtk-doc index [kleisauke]
22/12/22 8.14.0

View File

@ -829,3 +829,11 @@ vips_free( void *buf )
return( 0 );
}
/* Use vips_thread_isvips() instead.
*/
gboolean
vips_thread_isworker( void )
{
return( vips_thread_isvips() );
}

View File

@ -58,14 +58,14 @@ typedef struct {
VIPS_API
int vips_semaphore_up( VipsSemaphore *s );
VIPS_API
int vips_semaphore_down( VipsSemaphore *s );
VIPS_API
int vips_semaphore_down_timeout( VipsSemaphore *s, gint64 timeout );
VIPS_API
int vips_semaphore_upn( VipsSemaphore *s, int n );
VIPS_API
int vips_semaphore_down( VipsSemaphore *s );
VIPS_API
int vips_semaphore_downn( VipsSemaphore *s, int n );
VIPS_API
int vips_semaphore_down_timeout( VipsSemaphore *s, gint64 timeout );
VIPS_API
void vips_semaphore_destroy( VipsSemaphore *s );
VIPS_API
void vips_semaphore_init( VipsSemaphore *s, int v, char *name );

View File

@ -149,15 +149,18 @@ vips__semaphore_downn_until( VipsSemaphore *s, int n, gint64 end_time )
return( value_after_op );
}
/* Wait for sem>n, then subtract n.
/* Wait for sem>n, then subtract n. n must be >= 0. Returns the new semaphore
* value.
*/
int
vips_semaphore_downn( VipsSemaphore *s, int n )
{
g_assert( n >= 0 );
return( vips__semaphore_downn_until( s, n, -1 ) );
}
/* Wait for sem > 0, then decrement.
/* Wait for sem > 0, then decrement. Returns the new semaphore value.
*/
int
vips_semaphore_down( VipsSemaphore *s )
@ -166,8 +169,8 @@ vips_semaphore_down( VipsSemaphore *s )
}
/* Wait for sem > 0, then decrement.
* Returns -1 when the relative time in @timeout (in microseconds)
* was passed.
* Returns -1 when @timeout (in microseconds) has passed, or the new
* semaphore value.
*/
int
vips_semaphore_down_timeout( VipsSemaphore *s, gint64 timeout )

View File

@ -87,14 +87,6 @@ vips_thread_isvips( void )
return( g_private_get( is_vips_thread_key ) != NULL );
}
/* Deprecated compatibility function.
*/
gboolean
vips_thread_isworker( void )
{
return( vips_thread_isvips() );
}
/* Glib 2.32 revised the thread API. We need some compat functions.
*/