ast_threadpool_options Struct Reference

#include <threadpool.h>


Data Fields

int auto_increment
 Number of threads to increment pool by.
int idle_timeout
 Time limit in seconds for idle threads.
int initial_size
 Number of threads the pool will start with.
int max_size
 Maximum number of threads a pool may have.
void(* thread_end )(void)
 Function to call when a thread ends.
void(* thread_start )(void)
 Function to call when a thread starts.
int version


Detailed Description

Definition at line 70 of file threadpool.h.


Field Documentation

Number of threads to increment pool by.

If a task is added into a pool and no idle thread is available to activate, then the pool can automatically grow by the given amount.

Zero is a perfectly valid value to give here if you want to control threadpool growth yourself via your listener.

Definition at line 90 of file threadpool.h.

Referenced by queued_task_pushed(), stasis_init(), and system_apply().

Time limit in seconds for idle threads.

A time of 0 or less will mean no timeout.

Definition at line 79 of file threadpool.h.

Referenced by stasis_init(), system_apply(), and worker_idle().

Number of threads the pool will start with.

When the threadpool is allocated, it will immediately size itself to have this number of threads in it.

Zero is a valid value if the threadpool should start without any threads allocated.

Definition at line 100 of file threadpool.h.

Referenced by ast_threadpool_create(), stasis_init(), and system_apply().

int max_size

Maximum number of threads a pool may have.

When the threadpool's size increases, it can never increase beyond this number of threads.

Zero is a valid value if the threadpool does not have a maximum size.

Definition at line 110 of file threadpool.h.

Referenced by grow(), stasis_init(), and system_apply().

void(* thread_end)(void)

Function to call when a thread ends.

This is useful if there is common cleanup to execute when a thread completes

Referenced by worker_start().

void(* thread_start)(void)

Function to call when a thread starts.

This is useful if there is something common that all threads in a threadpool need to do when they start.

Referenced by load_module(), and worker_start().

int version

Version of threadpool options in use

Definition at line 73 of file threadpool.h.

Referenced by ast_sorcery_init(), AST_TEST_DEFINE(), ast_threadpool_create(), and stasis_init().


The documentation for this struct was generated from the following file:

Generated on Thu Apr 16 06:35:43 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6