5 Struct THREAD_POOL_NODE
gullradriel edited this page 2026-10-09 00:55:18 +02:00

THREAD_POOL_NODE

Module: THREADS: tools to create and manage a thread pool

#include "n_thread_pool.h"

Public Attributes

Name
int type
SYNCED or DIRECT process start.
int thread_state
state of the managing thread , RUNNING_THREAD, EXITING_THREAD, EXITED_THREAD
struct THREAD_POOL * thread_pool
pointer to assigned thread pool
pthread_t thr
thread id
sem_t th_start
thread starting semaphore
sem_t th_end
thread ending semaphore
int state
state of the proc , RUNNING_PROC when it is busy processing func( param) , IDLE_PROC when it waits for some func and param to process , WAITING_PROC when it has things waiting to be processed
void * param
if not NULL , passed as argument
pthread_mutex_t lock
mutex to prevent mutual access of node parameters
void ()(void *param) func
function to call in the thread

Public Attributes Documentation

variable type

int type;

SYNCED or DIRECT process start.

variable thread_state

int thread_state;

state of the managing thread , RUNNING_THREAD, EXITING_THREAD, EXITED_THREAD

variable thread_pool

struct THREAD_POOL * thread_pool;

pointer to assigned thread pool

variable thr

pthread_t thr;

thread id

variable th_start

sem_t th_start;

thread starting semaphore

variable th_end

sem_t th_end;

thread ending semaphore

variable state

int state;

state of the proc , RUNNING_PROC when it is busy processing func( param) , IDLE_PROC when it waits for some func and param to process , WAITING_PROC when it has things waiting to be processed

variable param

void * param;

if not NULL , passed as argument

variable lock

pthread_mutex_t lock;

mutex to prevent mutual access of node parameters

variable func

void *(*)(void *param) func;

function to call in the thread