Asterisk - The Open Source Telephony Project GIT-master-ff80666
Data Fields
ast_threadpool_options Struct Reference

#include <threadpool.h>

Data Fields

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

Detailed Description

Definition at line 72 of file threadpool.h.

Field Documentation

◆ auto_increment

int auto_increment

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 92 of file threadpool.h.

Referenced by queued_task_pushed(), and system_apply().

◆ idle_timeout

int idle_timeout

Time limit in seconds for idle threads.

A time of 0 or less will mean no timeout.

Definition at line 81 of file threadpool.h.

Referenced by system_apply(), and worker_idle().

◆ initial_size

int initial_size

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 102 of file threadpool.h.

Referenced by system_apply().

◆ max_size

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 112 of file threadpool.h.

Referenced by grow(), and system_apply().

◆ thread_end

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

Definition at line 126 of file threadpool.h.

Referenced by worker_start().

◆ thread_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.

Definition at line 119 of file threadpool.h.

Referenced by worker_start().

◆ version

int version

Version of threadpool options in use

Definition at line 75 of file threadpool.h.

Referenced by ParsingContext::next().


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