Go to the documentation of this file.
39 #ifndef SURICATA_UTIL_POOL_THREAD_H
40 #define SURICATA_UTIL_POOL_THREAD_H
68 PoolThread *
PoolThreadInit(
int threads, uint32_t size, uint32_t prealloc_size, uint32_t elt_size,
void *(*Alloc)(
void),
int (*Init)(
void *,
void *),
void *InitData,
void (*Cleanup)(
void *),
void (*Free)(
void *));
PoolThread * PoolThreadInit(int threads, uint32_t size, uint32_t prealloc_size, uint32_t elt_size, void *(*Alloc)(void), int(*Init)(void *, void *), void *InitData, void(*Cleanup)(void *), void(*Free)(void *))
initialize a thread pool
int PoolThreadExpand(PoolThread *pt)
grow a thread pool by one
void PoolThreadReturnRaw(PoolThread *pt, PoolThreadId id, void *data)
void PoolThreadFree(PoolThread *pt)
destroy the thread pool
struct PoolThread_ PoolThread
void PoolThreadReturn(PoolThread *pt, void *data)
return data to thread pool
void PoolThreadLock(PoolThread *pt, PoolThreadId id)
void PoolThreadRegisterTests(void)
void * PoolThreadGetById(PoolThread *pt, uint16_t id)
get data from thread pool by thread id
PoolThreadElement * array
int PoolThreadSize(PoolThread *pt)
get size of PoolThread (number of 'threads', so array elements)
void PoolThreadUnlock(PoolThread *pt, PoolThreadId id)