Chimera: chimera_0-9/include/job_queue.h File Reference

- Main Page
- Classes
- Files
- Directories

- File List
- File Members

# job_queue.h File Reference

Go to the source code of this file.

## Classes
struct | node
struct | List
struct | JobArgs
## Typedefs
typedef void(* | FuncPtr )(void *, void *)
typedef node | node
## Functions
void * | job_exec (void *job_q)
void | job_submit (List *job_q, FuncPtr func, void *args, int args_size)
List * | job_queue_init (int pool_size)

## Typedef Documentation

typedef void(* FuncPtr)(void *, void *)

typedef struct node node

## Function Documentation

void* job_exec | ( | void * | job_q | ) |

| get the queue mutex "access" then if the queue is emapty it would go to sleep and release the mutex else get the first job out of queue and execute it

List* job_queue_init | ( | int | pool_size | ) |

| initiate the queue and thread pool, returns a pointer to the initiated queue.

void job_submit | ( | List * | job_q,
|  | FuncPtr | func,
|  | void * | args,
|  | int | args_size
| ) |

| get the queue mutex "access", creat a new node and pass func,args,args_size, add the new node to the queue, and signal the thread pool if the queue was empty.