suricata
thread-callbacks.c File Reference
#include "thread-callbacks.h"
Include dependency graph for thread-callbacks.c:

Go to the source code of this file.

Data Structures

struct  ThreadInitCallback_
 

Typedefs

typedef struct ThreadInitCallback_ ThreadInitCallback
 

Functions

bool SCThreadRegisterInitCallback (SCThreadInitCallbackFn fn, void *user)
 Register a thread init callback. More...
 
void SCThreadRunInitCallbacks (ThreadVars *tv)
 

Typedef Documentation

◆ ThreadInitCallback

Function Documentation

◆ SCThreadRegisterInitCallback()

bool SCThreadRegisterInitCallback ( SCThreadInitCallbackFn  fn,
void *  user 
)

Register a thread init callback.

Register a user provided function to be called every time a thread is initialized for use.

Parameters
fnPointer to function to be called
userAdditional user data to be passed to callback
Returns
true if callback was registered, otherwise false if the callback could not be registered due to memory allocation error.

Definition at line 28 of file thread-callbacks.c.

References ThreadInitCallback_::Callback, SCCalloc, and ThreadInitCallback_::user.

◆ SCThreadRunInitCallbacks()

void SCThreadRunInitCallbacks ( ThreadVars tv)

Definition at line 48 of file thread-callbacks.c.