#include <processor.h>
◆ Processor()
apollo::cyber::scheduler::Processor::Processor |
( |
| ) |
|
◆ ~Processor()
apollo::cyber::scheduler::Processor::~Processor |
( |
| ) |
|
|
virtual |
◆ BindContext()
void apollo::cyber::scheduler::Processor::BindContext |
( |
const std::shared_ptr< ProcessorContext > & |
context | ) |
|
在文件 processor.cc 第 79 行定义.
79 {
80 context_ = context;
81 std::call_once(thread_flag_,
83}
◆ ProcSnapshot()
std::shared_ptr< Snapshot > apollo::cyber::scheduler::Processor::ProcSnapshot |
( |
| ) |
|
|
inline |
◆ Run()
void apollo::cyber::scheduler::Processor::Run |
( |
| ) |
|
在文件 processor.cc 第 40 行定义.
40 {
41 tid_.store(static_cast<int>(syscall(SYS_gettid)));
42 AINFO <<
"processor_tid: " << tid_;
43 snap_shot_->processor_id.store(tid_);
44
47 auto croutine = context_->NextRoutine();
48 if (croutine) {
50 snap_shot_->routine_name = croutine->name();
51 croutine->Resume();
52 croutine->Release();
53 } else {
54 snap_shot_->execute_start_time.store(0);
55 context_->Wait();
56 }
57 } else {
58 std::unique_lock<std::mutex> lk(mtx_ctx_);
59 cv_ctx_.wait_for(lk, std::chrono::milliseconds(10));
60 }
61 }
62}
static Time Now()
get the current time.
◆ Stop()
void apollo::cyber::scheduler::Processor::Stop |
( |
| ) |
|
在文件 processor.cc 第 64 行定义.
64 {
65 if (!running_.exchange(false)) {
66 return;
67 }
68
69 if (context_) {
70 context_->Shutdown();
71 }
72
73 cv_ctx_.notify_one();
74 if (thread_.joinable()) {
75 thread_.join();
76 }
77}
◆ Thread()
std::thread * apollo::cyber::scheduler::Processor::Thread |
( |
| ) |
|
|
inline |
◆ Tid()
std::atomic< pid_t > & apollo::cyber::scheduler::Processor::Tid |
( |
| ) |
|
在文件 processor.cc 第 85 行定义.
85 {
86 while (tid_.load() == -1) {
88 }
89 return tid_;
90}
该类的文档由以下文件生成: