Companion

object Companion

Functions

Link copied to clipboard
fun getMaxIdleTime(): <Error class: unknown class>

This function will return the maximum @interval that a thread will wait in the thread pool for new tasks before being stopped.

Link copied to clipboard
fun getMaxUnusedThreads(): <Error class: unknown class>

Returns the maximal allowed number of unused threads.

Link copied to clipboard
fun getNumUnusedThreads(): <Error class: unknown class>

Returns the number of currently unused threads.

Link copied to clipboard
fun new(func: Func, maxThreads: <Error class: unknown class>, exclusive: Boolean): <Error class: unknown class><ThreadPool>

This function creates a new thread pool.

Link copied to clipboard
fun newFull(func: Func, maxThreads: <Error class: unknown class>, exclusive: Boolean): <Error class: unknown class><ThreadPool>

This function creates a new thread pool similar to g_thread_pool_new() but allowing @item_free_func to be specified to free the data passed to g_thread_pool_push() in the case that the #GThreadPool is stopped and freed before all tasks have been executed.

Link copied to clipboard
fun setMaxIdleTime(interval: <Error class: unknown class>)

This function will set the maximum @interval that a thread waiting in the pool for new tasks can be idle for before being stopped. This function is similar to calling g_thread_pool_stop_unused_threads() on a regular timeout, except this is done on a per thread basis.

Link copied to clipboard
fun setMaxUnusedThreads(maxThreads: <Error class: unknown class>)

Sets the maximal number of unused threads to @max_threads. If @max_threads is -1, no limit is imposed on the number of unused threads.

Link copied to clipboard

Stops all currently unused threads. This does not change the maximal number of unused threads. This function can be used to regularly stop all unused threads e.g. from g_timeout_add().