ThreadPool.setMaxThreads

Sets the maximal allowed number of threads for pool. A value of -1 means, that the maximal number of threads is unlimited. Setting max_threads to 0 means stopping all work for pool. It is effectively frozen until max_threads is set to a non-zero value again. A thread is never terminated while calling func, as supplied by g_thread_pool_new(). Instead the maximal number of threads only has effect for the allocation of new threads in g_thread_pool_push(). A new thread is allocated, whenever the number of currently running threads in pool is smaller than the maximal number. error can be NULL to ignore errors, or non-NULL to report errors. An error can only occur when a new thread couldn't be created.

class ThreadPool
void
setMaxThreads

Parameters

maxThreads int

a new maximal number of threads for pool

Throws

GException on failure.

Meta