-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathThreadPool.h
More file actions
20 lines (11 loc) · 899 Bytes
/
ThreadPool.h
File metadata and controls
20 lines (11 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef __THREADPOOL_H__
#define __THREADPOOL_H__
#define DEBUG // 定义宏,DEBUG模式,打印尽可能多的的log信息,注释则不打印
typedef void ThreadPool_t; // 对外隐藏ThreadPool_t内部实现
ThreadPool_t* threadPool_Create(int min, int max, int queueCapacity); // 新创建一个线程池
int threadPool_Addtask(ThreadPool_t *, void (*)(void *), void *); // 向任务队列添加一个任务
int threadPool_Destroy(ThreadPool_t *); // 销毁一个线程池
void thread_Exit_unlock(ThreadPool_t *); // 线程退出函数
int getThreadLive(ThreadPool_t *); // 获得线程池中的存活线程数
int getThreadBusy(ThreadPool_t *); // 获得线程池中的忙线程数
#endif