Fetch the repository succeeded.
This action will force synchronization from 炕头哥/Ppool, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
#ifndef _PPOOL_H
#define _PPOOL_H
#include <pthread.h>
#include "ppool_queue.h"
typedef char pbool;
#define PTRUE 1
#define PFALSE 0
pthread_mutex_t PPOOL_LOCK;
#define ppool_entry() pthread_mutex_lock(&PPOOL_LOCK)
#define ppool_leave() pthread_mutex_unlock(&PPOOL_LOCK)
typedef struct
{
int pool_max_num; //线程池最大线程数量
int rel_num; //线程池中实例线程数
pool_w *head; //线程头
pthread_t *id; //线程id
pthread_mutex_t ppool_lock;
pthread_cond_t ppool_cond;
}pool_t;
//任务数据结构
typedef struct
{
int priority; //优先级
ppool_work task; //任务
void *arg; //参数
}pool_task;
//初始化一个线程池
pool_t *ppool_init(int pool_max_num);
//向线程池中添加一个任务
pbool ppool_add(pool_t *pool,pool_task *task);
//销毁一个线程池
void ppool_destroy(pool_t *pool);
#endif
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。