Advertisement

Linux多线程C++工具库:liblmp_tool(线程池类 ThreadPool)

阅读量:

基于Linux的多线程编程工具 liblmp_tool github: https://github.com/Dwyane05/liblmp_tool

使用条件变量和互斥锁实现线程池:

头文件:

/*

  • Use of this source code is governed by a BSD-style license
  • that can be found in the License file.
  • ThreadPool.h
  • Created on: May 30, 2019
  • Author: cuiyongfei
    */

#ifndef LMP_TOOL_THREADPOOL_H
#define LMP_TOOL_THREADPOOL_H

#include "Condition.h"
#include "Mutex.h"
#include "Thread.h"
#include "Common.h"

#include
#include

namespace lmp_tool
{

class ThreadPool : public noncopyable {
public::typedef std::function<void ()> Task; //功能说明

全部评论 (0)

还没有任何评论哟~