@@ -67,11 +67,11 @@ EventsExecutor::spin()
6767 event_queue_cv_.wait (push_lock, has_event_predicate);
6868 std::unique_lock<std::mutex> execution_lock (execution_mutex_);
6969 // We got an event! Swap queues while we hold both mutexes
70- std::swap (local_event_queue_ , event_queue_);
70+ std::swap (execution_event_queue_ , event_queue_);
7171 // After swapping the queues, we don't need the push lock anymore
7272 push_lock.unlock ();
7373 // Consume events while under the execution lock only
74- this ->consume_all_events (local_event_queue_ );
74+ this ->consume_all_events (execution_event_queue_ );
7575 }
7676 timers_manager_->stop ();
7777}
@@ -108,9 +108,9 @@ EventsExecutor::spin_some(std::chrono::nanoseconds max_duration)
108108 std::unique_lock<std::mutex> push_lock (push_mutex_);
109109 event_queue_cv_.wait_for (push_lock, max_duration, has_event_predicate);
110110 std::unique_lock<std::mutex> execution_lock (execution_mutex_);
111- std::swap (local_event_queue_ , event_queue_);
111+ std::swap (execution_event_queue_ , event_queue_);
112112 push_lock.unlock ();
113- this ->consume_all_events (local_event_queue_ );
113+ this ->consume_all_events (execution_event_queue_ );
114114 execution_lock.unlock ();
115115
116116 timers_manager_->execute_ready_timers ();
@@ -154,18 +154,18 @@ EventsExecutor::spin_all(std::chrono::nanoseconds max_duration)
154154 while (rclcpp::ok (context_) && spinning.load () && max_duration_not_elapsed ()) {
155155 std::unique_lock<std::mutex> push_lock (push_mutex_);
156156 std::unique_lock<std::mutex> execution_lock (execution_mutex_);
157- std::swap (local_event_queue_ , event_queue_);
157+ std::swap (execution_event_queue_ , event_queue_);
158158 push_lock.unlock ();
159159
160160 bool ready_timer = timers_manager_->get_head_timeout () < 0ns;
161- bool has_events = !local_event_queue_ .empty ();
161+ bool has_events = !execution_event_queue_ .empty ();
162162 if (!ready_timer && !has_events) {
163163 // Exit as there is no more work to do
164164 break ;
165165 }
166166 // Execute all ready work
167167
168- this ->consume_all_events (local_event_queue_ );
168+ this ->consume_all_events (execution_event_queue_ );
169169 execution_lock.unlock ();
170170
171171 timers_manager_->execute_ready_timers ();
0 commit comments