1 Star 1 Fork 0

Schips/quick-cpp

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
thread_pool.example.cpp 670 Bytes
一键复制 编辑 原始数据 按行查看 历史
Schips 提交于 2024-07-19 17:48 +08:00 . example : thread_pool : 删除无关内容
#include "thread_pool.hxx"
// 线程函数
static void thread_test(thread_context_t *thread_ctx)
{
char * pdata = (char *)getTaskArgFromContext(thread_ctx);
if(pdata)
{
printf("Data %p\n", pdata);
}
}
static class threadPool *m_pool;
int threadpool_demo(void)
{
int thread_count = 20;
int queue_size = 64;
char data1[256];
m_pool = new class threadPool(thread_count, queue_size);
m_pool->addTask(thread_test, data1);
//char data2[256];
//m_pool->addTask(thread_test, data2);
while(1);
delete m_pool;
return 0;
}
/*
int main(int argc, char * argv[])
{
threadpool_demo();
return 0;
}
*/
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/schips/quick-cpp.git
git@gitee.com:schips/quick-cpp.git
schips
quick-cpp
quick-cpp
master

搜索帮助