Project Alice
Loading...
Searching...
No Matches
pool.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 * All rights reserved.
4 *
5 * This source code is licensed under both the BSD-style license (found in the
6 * LICENSE file in the root directory of this source tree) and the GPLv2 (found
7 * in the COPYING file in the root directory of this source tree).
8 * You may select, at your option, one of the above-listed licenses.
9 */
10
11#ifndef POOL_H
12#define POOL_H
13
14#if defined (__cplusplus)
15extern "C" {
16#endif
17
18
19#include "zstd_deps.h"
20#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_customMem */
21#include "../zstd.h"
22
23typedef struct POOL_ctx_s POOL_ctx;
24
31POOL_ctx* POOL_create(size_t numThreads, size_t queueSize);
32
33POOL_ctx* POOL_create_advanced(size_t numThreads, size_t queueSize,
34 ZSTD_customMem customMem);
35
39void POOL_free(POOL_ctx* ctx);
40
41
45void POOL_joinJobs(POOL_ctx* ctx);
46
56int POOL_resize(POOL_ctx* ctx, size_t numThreads);
57
62size_t POOL_sizeof(const POOL_ctx* ctx);
63
67typedef void (*POOL_function)(void*);
68
75void POOL_add(POOL_ctx* ctx, POOL_function function, void* opaque);
76
77
83int POOL_tryAdd(POOL_ctx* ctx, POOL_function function, void* opaque);
84
85
86#if defined (__cplusplus)
87}
88#endif
89
90#endif
POOL_ctx * POOL_create(size_t numThreads, size_t queueSize)
Definition: pool.c:326
int POOL_resize(POOL_ctx *ctx, size_t numThreads)
Definition: pool.c:349
void(* POOL_function)(void *)
Definition: pool.h:67
void POOL_add(POOL_ctx *ctx, POOL_function function, void *opaque)
Definition: pool.c:354
size_t POOL_sizeof(const POOL_ctx *ctx)
Definition: pool.c:365
void POOL_free(POOL_ctx *ctx)
Definition: pool.c:339
POOL_ctx * POOL_create_advanced(size_t numThreads, size_t queueSize, ZSTD_customMem customMem)
Definition: pool.c:331
void POOL_joinJobs(POOL_ctx *ctx)
Definition: pool.c:344
int POOL_tryAdd(POOL_ctx *ctx, POOL_function function, void *opaque)
Definition: pool.c:359