Motr  M0
thread_pool.c File Reference
#include "lib/trace.h"
#include "lib/thread_pool.h"
#include "lib/memory.h"
#include "lib/assert.h"
#include "lib/errno.h"
Include dependency graph for thread_pool.c:

Go to the source code of this file.

Data Structures

struct  m0_parallel_queue_link
 
struct  m0_parallel_queue
 

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_LIB
 

Enumerations

enum  m0_parallel_pool_state { PPS_IDLE = 1, PPS_BUSY, PPS_TERMINATING, PPS_TERMINATED }
 

Functions

static struct m0_parallel_queue_linkparallel_queue_get (struct m0_parallel_queue *queue)
 
static void parallel_queue_add (struct m0_parallel_queue *queue, struct m0_parallel_queue_link *link)
 
static void parallel_queue_init (struct m0_parallel_queue *queue)
 
static void parallel_queue_fini (struct m0_parallel_queue *queue)
 
static void parallel_queue_link_init (struct m0_parallel_queue_link *l)
 
static void pool_thread (struct m0_parallel_pool *pool)
 
static void pool_threads_fini (struct m0_parallel_pool *pool, bool join)
 
static void parallel_pool_fini (struct m0_parallel_pool *pool, bool join)
 
static int pool_threads_init (struct m0_parallel_pool *pool, int thread_nr, int qlink_nr)
 
M0_INTERNAL int m0_parallel_pool_init (struct m0_parallel_pool *pool, int thread_nr, int qlinks_nr)
 
M0_INTERNAL void m0_parallel_pool_fini (struct m0_parallel_pool *pool)
 
M0_INTERNAL void m0_parallel_pool_start (struct m0_parallel_pool *pool, int(*process)(void *item))
 
M0_INTERNAL int m0_parallel_pool_wait (struct m0_parallel_pool *pool)
 
M0_INTERNAL void m0_parallel_pool_terminate_wait (struct m0_parallel_pool *pool)
 
M0_INTERNAL int m0_parallel_pool_job_add (struct m0_parallel_pool *pool, void *item)
 
M0_INTERNAL int m0_parallel_pool_rc_next (struct m0_parallel_pool *pool, void **job, int *rc)