ThreadPool

class ThreadPool(pointer: <Error class: unknown class><<Error class: unknown class>>) : Record

The #GThreadPool struct represents a thread pool. It has three public read-only members, but the underlying struct is bigger, so you must not copy this struct.

Skipped during bindings generation

  • parameter data: gpointer

  • parameter data: gpointer

  • field func: Func

  • field user_data: gpointer

Constructors

Link copied to clipboard
constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion : RecordCompanion<ThreadPool, <Error class: unknown class>>

Properties

Link copied to clipboard

are all threads exclusive to this pool

Link copied to clipboard
val glibThreadPoolPointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard
fun free(immediate: Boolean, wait: Boolean)

Frees all resources allocated for @pool.

Link copied to clipboard

Returns the maximal number of threads for @pool.

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

Returns the number of threads currently running in @pool.

Link copied to clipboard
fun setMaxThreads(maxThreads: Int): <Error class: unknown class><Boolean>

Sets the maximal allowed number of threads for @pool. A value of -1 means that the maximal number of threads is unlimited. If @pool is an exclusive thread pool, setting the maximal number of threads to -1 is not allowed.

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

Returns the number of tasks still unprocessed in @pool.