libsheepy
Data Structures | Macros | Typedefs | Functions | Variables
tpool.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  tpoolArgs
 

Macros

#define tpoolLockCount   512
 
#define tpoolAdd(task, args)   tpool_add_work(tpool, task, args)
 
#define tpoolWait   tpool_wait(tpool)
 
#define tpoolKill   tpool_destroy(tpool)
 
#define tpoolPause   tpool_pause(tpool)
 
#define tpoolResume   tpool_resume(tpool)
 
#define tpoolNum   tpool_num_threads_working(tpool)
 

Typedefs

typedef struct tpool_threadpool
 

Functions

void tpoolLock (int position)
 
void tpoolUlock (int position)
 
threadpool tpool_init (int num_threads)
 
int tpool_add_work (threadpool, void(*function_p)(void *), void *arg_p)
 
void tpool_wait (threadpool)
 
void tpool_pause (threadpool)
 
void tpool_resume (threadpool)
 
void tpool_destroy (threadpool)
 
int tpool_num_threads_working (threadpool)
 

Variables

pthread_mutex_t tpoolLocks [tpoolLockCount]
 
threadpool tpool
 

Macro Definition Documentation

◆ tpoolLockCount

#define tpoolLockCount   512
Examples:
/home/rlp/git/sw/libsheepy/release/tpool.h.

Definition at line 19 of file tpool.h.

◆ tpoolAdd

#define tpoolAdd (   task,
  args 
)    tpool_add_work(tpool, task, args)

Definition at line 44 of file tpool.h.

◆ tpoolWait

#define tpoolWait   tpool_wait(tpool)

Definition at line 45 of file tpool.h.

◆ tpoolKill

#define tpoolKill   tpool_destroy(tpool)

Definition at line 46 of file tpool.h.

◆ tpoolPause

#define tpoolPause   tpool_pause(tpool)

Definition at line 47 of file tpool.h.

◆ tpoolResume

#define tpoolResume   tpool_resume(tpool)

Definition at line 48 of file tpool.h.

◆ tpoolNum

#define tpoolNum   tpool_num_threads_working(tpool)

Definition at line 49 of file tpool.h.

Typedef Documentation

◆ threadpool

typedef struct tpool_* threadpool
Examples:
/home/rlp/git/sw/libsheepy/release/tpool.h.

Definition at line 54 of file tpool.h.

Function Documentation

◆ tpoolLock()

void tpoolLock ( int  position)
Examples:
/home/rlp/git/sw/libsheepy/release/tpool.h.

Definition at line 127 of file tpool.c.

◆ tpoolUlock()

void tpoolUlock ( int  position)
Examples:
/home/rlp/git/sw/libsheepy/release/tpool.h.

Definition at line 132 of file tpool.c.

◆ tpool_init()

threadpool tpool_init ( int  num_threads)
Examples:
/home/rlp/git/sw/libsheepy/release/tpool.h.

Definition at line 137 of file tpool.c.

Here is the caller graph for this function:

◆ tpool_add_work()

int tpool_add_work ( threadpool  ,
void(*)(void *)  function_p,
void *  arg_p 
)
Examples:
/home/rlp/git/sw/libsheepy/release/tpool.h.

Definition at line 192 of file tpool.c.

◆ tpool_wait()

void tpool_wait ( threadpool  )
Examples:
/home/rlp/git/sw/libsheepy/release/tpool.h.

Definition at line 221 of file tpool.c.

◆ tpool_pause()

void tpool_pause ( threadpool  )
Examples:
/home/rlp/git/sw/libsheepy/release/tpool.h.

Definition at line 282 of file tpool.c.

◆ tpool_resume()

void tpool_resume ( threadpool  )
Examples:
/home/rlp/git/sw/libsheepy/release/tpool.h.

Definition at line 292 of file tpool.c.

◆ tpool_destroy()

void tpool_destroy ( threadpool  )
Examples:
/home/rlp/git/sw/libsheepy/release/tpool.h.

Definition at line 232 of file tpool.c.

◆ tpool_num_threads_working()

int tpool_num_threads_working ( threadpool  )
Examples:
/home/rlp/git/sw/libsheepy/release/tpool.h.

Definition at line 304 of file tpool.c.

Variable Documentation

◆ tpoolLocks

pthread_mutex_t tpoolLocks[tpoolLockCount]
Examples:
/home/rlp/git/sw/libsheepy/release/tpool.h.

Definition at line 45 of file tpool.c.

◆ tpool

threadpool tpool
Examples:
/home/rlp/git/sw/libsheepy/release/tpool.h.

Definition at line 47 of file tpool.c.