Home

Traffic Server Software Developers Kit

Thread Functions

The Traffic Server API thread functions enable you to create, destroy, and identify threads within Traffic Server. Multithreading enables a single program to have more than one stream of execution and to process more than one transaction at a time.

Threads serialize their access to shared resources and data using the INKMutex type, as described in Mutexes.

The thread functions are described below.

INKThreadCreate

Creates a new thread.

Prototype

INKThread INKThreadCreate (INKThreadFunc func, void *data)

Arguments

INKThreadFunc func is the function the new thread executes.

void *data is the data passed as an argument to func.

Description

Creates a new thread and calls func with the argument data. When func exits, the thread is automatically destroyed.

[Note] Note

The INKThread return pointer does not indicate the status of the new thread and cannot be modified.

Returns

A valid pointer to an INKThread object if successful.

A NULL pointer if there is an error.