Skip to content

Commit 09e6a4c

Browse files
authored
Merge pull request #20 from tier4/expt-yano
fix: dirty
2 parents d9a29f2 + 83132c1 commit 09e6a4c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

callback_isolated_executor/src/component_container_callback_isolated.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class ComponentManagerCallbackIsolated
5151
node_id_to_executor_wrappers_;
5252
rclcpp::Publisher<cie_config_msgs::msg::CallbackGroupInfo>::SharedPtr
5353
client_publisher_;
54+
std::mutex client_publisher_mutex_;
5455
};
5556

5657
ComponentManagerCallbackIsolated::~ComponentManagerCallbackIsolated() {
@@ -141,9 +142,8 @@ void ComponentManagerCallbackIsolated::add_node_to_executor(uint64_t node_id) {
141142
std::thread([&executor_wrapper, group_id, this]() {
142143
auto tid = syscall(SYS_gettid);
143144

144-
// dirty
145-
for (int i = 0; i < 3; i++) {
146-
std::this_thread::sleep_for(std::chrono::milliseconds(100));
145+
{
146+
std::lock_guard<std::mutex> lock(this->client_publisher_mutex_);
147147
cie_thread_configurator::publish_callback_group_info(
148148
this->client_publisher_, tid, group_id);
149149
}

0 commit comments

Comments
 (0)