Public Member Functions | Private Member Functions | Private Attributes | List of all members
cartographer::common::ThreadPool Class Reference

#include <thread_pool.h>

Public Member Functions

ThreadPooloperator= (const ThreadPool &)=delete
 
void Schedule (std::function< void()> work_item)
 
 ThreadPool (int num_threads)
 
 ThreadPool (const ThreadPool &)=delete
 
 ~ThreadPool ()
 

Private Member Functions

void DoWork ()
 
bool running_ GUARDED_BY (mutex_)
 
std::vector< std::thread > pool_ GUARDED_BY (mutex_)
 
std::deque< std::function< void()> > work_queue_ GUARDED_BY (mutex_)
 

Private Attributes

Mutex mutex_
 

Detailed Description

Definition at line 35 of file thread_pool.h.

Constructor & Destructor Documentation

cartographer::common::ThreadPool::ThreadPool ( int  num_threads)
explicit

Definition at line 29 of file thread_pool.cc.

cartographer::common::ThreadPool::~ThreadPool ( )

Definition at line 36 of file thread_pool.cc.

cartographer::common::ThreadPool::ThreadPool ( const ThreadPool )
delete

Member Function Documentation

void cartographer::common::ThreadPool::DoWork ( )
private

Definition at line 54 of file thread_pool.cc.

bool running_ cartographer::common::ThreadPool::GUARDED_BY ( mutex_  )
private
std::vector<std::thread> pool_ cartographer::common::ThreadPool::GUARDED_BY ( mutex_  )
private
std::deque<std::function<void()> > work_queue_ cartographer::common::ThreadPool::GUARDED_BY ( mutex_  )
private
ThreadPool& cartographer::common::ThreadPool::operator= ( const ThreadPool )
delete
void cartographer::common::ThreadPool::Schedule ( std::function< void()>  work_item)

Definition at line 48 of file thread_pool.cc.

Member Data Documentation

Mutex cartographer::common::ThreadPool::mutex_
private

Definition at line 48 of file thread_pool.h.


The documentation for this class was generated from the following files:


cartographer
Author(s):
autogenerated on Mon Jun 10 2019 12:51:39