int main (int argc, char **argv) { //初始化线程池 initThreadPool(3); int t[10] = {0}; int i = 0; for (i = 0; i < 10; ++i) { t[i] = i; addTaskToPool(doTask, &t[i]); } sleep(10);//测试,等待子线程结束 destroyPool(); return 0; //加入任务 //退出 释放互斥量 清理内存 }
MongoDBConnectionPool::~MongoDBConnectionPool() { destroyPool(); }
void UIActionPool::cleanup() { /* Destroy pool: */ destroyPool(); }
ThreadPool::~ThreadPool() { destroyPool(); }
CMemoryPool::~CMemoryPool() { /*销毁内存池*/ destroyPool(); }
MemoryCacheImpl::~MemoryCacheImpl() { destroyPool(); }