@@ -70,6 +70,8 @@ class ExecutorEntitiesCollector
7070 RCLCPP_PUBLIC
7171 ~ExecutorEntitiesCollector ();
7272
73+ bool has_pending ();
74+
7375 // / Add a node to the entity collector
7476 /* *
7577 * \param[in] node_ptr a shared pointer that points to a node base interface
@@ -164,63 +166,66 @@ class ExecutorEntitiesCollector
164166
165167 using WeakNodesToGuardConditionsMap = std::map<
166168 rclcpp::node_interfaces::NodeBaseInterface::WeakPtr,
167- const rclcpp::GuardCondition * ,
169+ rclcpp::GuardCondition::WeakPtr ,
168170 std::owner_less<rclcpp::node_interfaces::NodeBaseInterface::WeakPtr>>;
169171
170172 using WeakGroupsToGuardConditionsMap = std::map<
171173 rclcpp::CallbackGroup::WeakPtr,
172- const rclcpp::GuardCondition * ,
174+ rclcpp::GuardCondition::WeakPtr ,
173175 std::owner_less<rclcpp::CallbackGroup::WeakPtr>>;
174176
175177 RCLCPP_PUBLIC
176178 NodeCollection::iterator
177- remove_weak_node (NodeCollection::iterator weak_node) RCPPUTILS_TSA_REQUIRES(mutex_) ;
179+ remove_weak_node (NodeCollection::iterator weak_node);
178180
179181 RCLCPP_PUBLIC
180182 CallbackGroupCollection::iterator
181183 remove_weak_callback_group (
182184 CallbackGroupCollection::iterator weak_group_it,
183- CallbackGroupCollection & collection) RCPPUTILS_TSA_REQUIRES(mutex_) ;
185+ CallbackGroupCollection & collection);
184186
185187 RCLCPP_PUBLIC
186188 void
187189 add_callback_group_to_collection (
188190 rclcpp::CallbackGroup::SharedPtr group_ptr,
189- CallbackGroupCollection & collection) RCPPUTILS_TSA_REQUIRES(mutex_) ;
191+ CallbackGroupCollection & collection);
190192
191193 RCLCPP_PUBLIC
192194 void
193195 remove_callback_group_from_collection (
194196 rclcpp::CallbackGroup::SharedPtr group_ptr,
195- CallbackGroupCollection & collection) RCPPUTILS_TSA_REQUIRES(mutex_) ;
197+ CallbackGroupCollection & collection);
196198
197199 RCLCPP_PUBLIC
198200 void
199- add_automatically_associated_callback_groups (
200- const NodeCollection & nodes_to_check)
201- RCPPUTILS_TSA_REQUIRES (mutex_);
201+ process_queues ();
202202
203203 RCLCPP_PUBLIC
204204 void
205- prune_invalid_nodes_and_groups () RCPPUTILS_TSA_REQUIRES(mutex_);
205+ add_automatically_associated_callback_groups (
206+ const NodeCollection & nodes_to_check);
206207
207- mutable std::mutex mutex_;
208+ RCLCPP_PUBLIC
209+ void
210+ prune_invalid_nodes_and_groups ();
208211
209212 // / Callback groups that were added via `add_callback_group`
210- CallbackGroupCollection
211- manually_added_groups_ RCPPUTILS_TSA_GUARDED_BY (mutex_);
213+ CallbackGroupCollection manually_added_groups_;
212214
213215 // / Callback groups that were added by their association with added nodes
214- CallbackGroupCollection
215- automatically_added_groups_ RCPPUTILS_TSA_GUARDED_BY (mutex_);
216+ CallbackGroupCollection automatically_added_groups_;
216217
217218 // / nodes that are associated with the executor
218- NodeCollection
219- weak_nodes_ RCPPUTILS_TSA_GUARDED_BY (mutex_);
219+ NodeCollection weak_nodes_;
220220
221- WeakNodesToGuardConditionsMap weak_nodes_to_guard_conditions_ RCPPUTILS_TSA_GUARDED_BY (mutex_);
221+ std::mutex pending_mutex_;
222+ NodeCollection pending_added_nodes_;
223+ NodeCollection pending_removed_nodes_;
224+ CallbackGroupCollection pending_manually_added_groups_;
225+ CallbackGroupCollection pending_manually_removed_groups_;
222226
223- WeakGroupsToGuardConditionsMap weak_groups_to_guard_conditions_ RCPPUTILS_TSA_GUARDED_BY (mutex_);
227+ WeakNodesToGuardConditionsMap weak_nodes_to_guard_conditions_;
228+ WeakGroupsToGuardConditionsMap weak_groups_to_guard_conditions_;
224229
225230 std::shared_ptr<ExecutorNotifyWaitable> notify_waitable_;
226231};
0 commit comments