1 Star 0 Fork 4

Genius / libthpool

forked from siasjack / libthpool 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
libthpool.h 915 Bytes
一键复制 编辑 原始数据 按行查看 历史
siasjack 提交于 2019-11-12 22:20 . first commit
//
// libthpool.h
// libthpool
//
// Created by 陈健康 on 2019/11/12.
// Copyright © 2019 陈健康. All rights reserved.
//
#ifndef libthpool_h
#define libthpool_h
#define OPCODE_SUCCESS 0
#define OPCODE_FAILURE -1
#define OPCODE_ERR_PARA -2
#define OPCODE_ERR_BIND_DEV -3
#define OPCODE_ERR_BIND_PORT -4
#define OPCODE_ERR_ILLEGAL_FD -5
#define OPCODE_ERR_BUSY -6
typedef struct threadpool_t threadpool_t;
typedef void(*task_func)(void *arg);
typedef struct task_data{
//this arg must set like malloc,libthpool will call free(arg)
void *arg;
task_func task_func;
}libthpool_taskdata_t;
threadpool_t * libthpool_init(int min_thr_num, int max_thr_num, int queue_max_size);
int libthpool_destroy(threadpool_t *pool);
int libthpool_task_put(threadpool_t *pool, task_func function, void *arg);
int libthpool_state(int *task_queue,int *live_thr_num,int *busy_thr_num);
#endif /* libthpool_h */
C
1
https://gitee.com/genius_jiao/libthpool.git
git@gitee.com:genius_jiao/libthpool.git
genius_jiao
libthpool
libthpool
master

搜索帮助