Function

VipsThreadpoolAllocateFn

Declaration

int
(* VipsThreadpoolAllocateFn) (
  VipsThreadState* state,
  void* a,
  gboolean* stop
)

Description [src]

This function is called to allocate a new work unit for the thread. It is always single-threaded, so it can modify per-pool state (such as a counter).

It should set stop to TRUE to indicate that no work could be allocated because the job is done.

::: seealso vips_threadpool_run().

Parameters

state VipsThreadState
 

Per-thread state.

 The data is owned by the caller of the function.
a void*
 

Client data.

 The argument can be NULL.
 The data is owned by the caller of the function.
stop gboolean*
 

Set this to signal end of computation.

 The data is owned by the caller of the function.

Return value

Returns: int
 

0 on success, or -1 on error.