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

#include <thread_pool.h>

Inheritance diagram for cartographer::common::ThreadPool:
Inheritance graph
[legend]

Public Member Functions

ThreadPooloperator= (const ThreadPool &)=delete
 
std::weak_ptr< TaskSchedule (std::unique_ptr< Task > task) EXCLUDES(mutex_) override
 
 ThreadPool (int num_threads)
 
 ThreadPool (const ThreadPool &)=delete
 
 ~ThreadPool ()
 
- Public Member Functions inherited from cartographer::common::ThreadPoolInterface
 ThreadPoolInterface ()
 
virtual ~ThreadPoolInterface ()
 

Private Member Functions

void DoWork ()
 
bool running_ GUARDED_BY (mutex_)
 
std::vector< std::thread > pool_ GUARDED_BY (mutex_)
 
std::deque< std::shared_ptr< Task > > task_queue_ GUARDED_BY (mutex_)
 
std::unordered_map< Task *, std::shared_ptr< Task > > tasks_not_ready_ GUARDED_BY (mutex_)
 
void NotifyDependenciesCompleted (Task *task) EXCLUDES(mutex_) override
 

Private Attributes

Mutex mutex_
 

Additional Inherited Members

- Protected Member Functions inherited from cartographer::common::ThreadPoolInterface
void Execute (Task *task)
 
void SetThreadPool (Task *task)
 

Detailed Description

Definition at line 57 of file thread_pool.h.

Constructor & Destructor Documentation

◆ ThreadPool() [1/2]

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

Definition at line 37 of file thread_pool.cc.

◆ ~ThreadPool()

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

Definition at line 44 of file thread_pool.cc.

◆ ThreadPool() [2/2]

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

Member Function Documentation

◆ DoWork()

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

Definition at line 80 of file thread_pool.cc.

◆ GUARDED_BY() [1/4]

bool running_ cartographer::common::ThreadPool::GUARDED_BY ( mutex_  )
private

◆ GUARDED_BY() [2/4]

std::vector<std::thread> pool_ cartographer::common::ThreadPool::GUARDED_BY ( mutex_  )
private

◆ GUARDED_BY() [3/4]

std::deque<std::shared_ptr<Task> > task_queue_ cartographer::common::ThreadPool::GUARDED_BY ( mutex_  )
private

◆ GUARDED_BY() [4/4]

std::unordered_map<Task*, std::shared_ptr<Task> > tasks_not_ready_ cartographer::common::ThreadPool::GUARDED_BY ( mutex_  )
private

◆ NotifyDependenciesCompleted()

void cartographer::common::ThreadPool::NotifyDependenciesCompleted ( Task task)
overrideprivatevirtual

Implements cartographer::common::ThreadPoolInterface.

Definition at line 57 of file thread_pool.cc.

◆ operator=()

ThreadPool& cartographer::common::ThreadPool::operator= ( const ThreadPool )
delete

◆ Schedule()

std::weak_ptr< Task > cartographer::common::ThreadPool::Schedule ( std::unique_ptr< Task task)
overridevirtual

Implements cartographer::common::ThreadPoolInterface.

Definition at line 66 of file thread_pool.cc.

Member Data Documentation

◆ mutex_

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

Definition at line 75 of file thread_pool.h.


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


cartographer
Author(s): The Cartographer Authors
autogenerated on Mon Feb 28 2022 22:00:59