43 t_magic, 0x1111111111111111, 0x1111111111111111);
46 { .t_count = 1 }, { .t_count = 2 }, { .t_count = 3 }, { .t_count = 4 },
47 { .t_count = 5 }, { .t_count = 6 }, { .t_count = 7 }, { .t_count = 8 },
50 { .
t_count = 1 }, { .t_count = 2, .t_rc = -EINTR, },
51 { .t_count = 3 }, { .t_count = 4, .t_rc = -ENOMEM, },
52 { .t_count = 5 }, { .t_count = 6, .t_rc = -E2BIG, },
53 { .t_count = 7 }, { .t_count = 8, .t_rc = -EINTR, },
96 for (
i = 0;
i < sz; ++
i) {
109 for (; rounds > 0; --rounds) {
123 for (; rounds > 0; --rounds) {
129 tpt_tlist_init(&items);
132 tpt_tlink_init_at(&
test[
i], &items);
142 tpt_tlist_fini(&items);
152 for (; rounds > 0; --rounds) {
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)
static void thread_pool_init(struct m0_parallel_pool *pool)
static int thread_pool_process(void *item)
static void thread_pool_fini(struct m0_parallel_pool *pool)
M0_INTERNAL void m0_parallel_pool_start(struct m0_parallel_pool *pool, int(*process)(void *item))
static const int QLINKS_NR
#define M0_PARALLEL_FOR(name, pool, list, process)
M0_INTERNAL int m0_parallel_pool_wait(struct m0_parallel_pool *pool)
static struct m0_rpc_item * item
static void parallel_for_pool_test(struct m0_parallel_pool *pool)
M0_INTERNAL void m0_parallel_pool_fini(struct m0_parallel_pool *pool)
static const int THREAD_NR
#define m0_tl_teardown(name, head, obj)
static struct m0_thread t[8]
M0_INTERNAL int m0_parallel_pool_init(struct m0_parallel_pool *pool, int thread_nr, int qlinks_nr)
M0_TL_DESCR_DEFINE(tpt, "tpt-s", static, struct tpool_test, t_linkage, t_magic, 0x1111111111111111, 0x1111111111111111)
struct tpool_test error_test[]
M0_INTERNAL void m0_parallel_pool_terminate_wait(struct m0_parallel_pool *pool)
static struct m0_pool pool
static int64_t m0_atomic64_get(const struct m0_atomic64 *a)
static void simple_thread_pool_test(struct m0_parallel_pool *pool)
static const int ROUNDS_NR
M0_TL_DEFINE(tpt, static, struct tpool_test)
static void feed(struct m0_parallel_pool *pool, bool err_test)
static struct m0_atomic64 counts
static uint64_t test_counts
void m0_ut_lib_thread_pool_test(void)
struct m0_tlink t_linkage
static void small_thread_pool_init(struct m0_parallel_pool *pool)
static void m0_atomic64_add(struct m0_atomic64 *a, int64_t num)
static void simple_thread_pool_error_test(struct m0_parallel_pool *pool)
static void m0_atomic64_set(struct m0_atomic64 *a, int64_t num)