提交 10bfd891 编写于 作者: D Dong Li 提交者: Jiangtao Hu

planning: prefer unique_ptr than shared_ptr

上级 c20031d8
...@@ -106,9 +106,9 @@ bool ReferenceLineProvider::Start() { ...@@ -106,9 +106,9 @@ bool ReferenceLineProvider::Start() {
} }
if (FLAGS_enable_reference_line_provider_thread) { if (FLAGS_enable_reference_line_provider_thread) {
task_ = std::make_shared<apollo::cybertron::Task<int>>( task_.reset(new apollo::cybertron::Task<int>(
"async_reference_line_provider", "async_reference_line_provider",
[this](const std::shared_ptr<int> &) { this->GenerateThread(); }); [this](const std::shared_ptr<int> &) { this->GenerateThread(); }));
task_future_ = task_->Execute(std::make_shared<int>()); task_future_ = task_->Execute(std::make_shared<int>());
} }
return true; return true;
......
...@@ -180,7 +180,7 @@ class ReferenceLineProvider { ...@@ -180,7 +180,7 @@ class ReferenceLineProvider {
std::queue<std::list<ReferenceLine>> reference_line_history_; std::queue<std::list<ReferenceLine>> reference_line_history_;
std::queue<std::list<hdmap::RouteSegments>> route_segments_history_; std::queue<std::list<hdmap::RouteSegments>> route_segments_history_;
std::shared_ptr<cybertron::Task<int>> task_; std::unique_ptr<cybertron::Task<int>> task_;
std::future<void> task_future_; std::future<void> task_future_;
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册