#include <thread_pool.h>
◆ ThreadPool() [1/2]
| apollo::perception::lib::ThreadPool::ThreadPool |
( |
int |
num_workers | ) |
|
|
explicit |
在文件 thread_pool.cc 第 27 行定义.
31 started_(false) {
32 workers_.reserve(num_workers_);
33 for (int idx = 0; idx < num_workers_; ++idx) {
35 workers_.push_back(worker);
36 }
37}
friend class ThreadPoolWorker
◆ ~ThreadPool()
| apollo::perception::lib::ThreadPool::~ThreadPool |
( |
| ) |
|
在文件 thread_pool.cc 第 39 行定义.
39 {
40 if (!started_) {
41 return;
42 }
43
44 for (int idx = 0; idx < num_workers_; ++idx) {
46 }
47
48 for (int idx = 0; idx < num_workers_; ++idx) {
49 workers_[idx]->Join();
50 delete workers_[idx];
51 }
52}
void Add(google::protobuf::Closure *closure)
◆ ThreadPool() [2/2]
| apollo::perception::lib::ThreadPool::ThreadPool |
( |
const ThreadPool & |
| ) |
|
|
delete |
◆ Add() [1/2]
| void apollo::perception::lib::ThreadPool::Add |
( |
const std::vector< google::protobuf::Closure * > & |
closures | ) |
|
◆ Add() [2/2]
| void apollo::perception::lib::ThreadPool::Add |
( |
google::protobuf::Closure * |
closure | ) |
|
◆ num_available_workers()
| int apollo::perception::lib::ThreadPool::num_available_workers |
( |
| ) |
const |
|
inline |
◆ num_workers()
| int apollo::perception::lib::ThreadPool::num_workers |
( |
| ) |
const |
|
inline |
◆ operator=()
◆ Start()
| void apollo::perception::lib::ThreadPool::Start |
( |
| ) |
|
在文件 thread_pool.cc 第 54 行定义.
54 {
55 for (int idx = 0; idx < num_workers_; ++idx) {
56 workers_[idx]->Start();
57 }
58 started_ = true;
59}
◆ ThreadPoolWorker
该类的文档由以下文件生成: