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.
Creates a new thread.
INKThread INKThreadCreate (INKThreadFunc
func
, void
*data
)
INKThreadFunc
is the function
the new thread executes.func
void
is the
data passed as an argument to
*data
.func
Creates a new thread and calls
with the argument
func
. When
data
exits, the thread
is automatically destroyed.func
Note | |
---|---|
The |
A valid pointer to an INKThread
object if successful.
A NULL
pointer if there is an error.