File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,10 +110,10 @@ Executor::spin_node_some(rclcpp::node::Node::SharedPtr node)
110110void
111111Executor::spin_some ()
112112{
113- RCLCPP_SCOPE_EXIT (this ->spinning .store (false ); );
114113 if (spinning.exchange (true )) {
115114 throw std::runtime_error (" spin_some() called while already spinning" );
116115 }
116+ RCLCPP_SCOPE_EXIT (this ->spinning .store (false ); );
117117 AnyExecutable::SharedPtr any_exec;
118118 while ((any_exec = get_next_executable (std::chrono::milliseconds::zero ())) && spinning.load ()) {
119119 execute_any_executable (any_exec);
@@ -123,10 +123,10 @@ Executor::spin_some()
123123void
124124Executor::spin_once (std::chrono::nanoseconds timeout)
125125{
126- RCLCPP_SCOPE_EXIT (this ->spinning .store (false ); );
127126 if (spinning.exchange (true )) {
128127 throw std::runtime_error (" spin_once() called while already spinning" );
129128 }
129+ RCLCPP_SCOPE_EXIT (this ->spinning .store (false ); );
130130 auto any_exec = get_next_executable (timeout);
131131 if (any_exec) {
132132 execute_any_executable (any_exec);
Original file line number Diff line number Diff line change @@ -38,10 +38,10 @@ MultiThreadedExecutor::~MultiThreadedExecutor() {}
3838void
3939MultiThreadedExecutor::spin ()
4040{
41- RCLCPP_SCOPE_EXIT (this ->spinning .store (false ); );
4241 if (spinning.exchange (true )) {
4342 throw std::runtime_error (" spin() called while already spinning" );
4443 }
44+ RCLCPP_SCOPE_EXIT (this ->spinning .store (false ); );
4545 std::vector<std::thread> threads;
4646 {
4747 std::lock_guard<std::mutex> wait_lock (wait_mutex_);
Original file line number Diff line number Diff line change @@ -28,10 +28,10 @@ SingleThreadedExecutor::~SingleThreadedExecutor() {}
2828void
2929SingleThreadedExecutor::spin ()
3030{
31- RCLCPP_SCOPE_EXIT (this ->spinning .store (false ); );
3231 if (spinning.exchange (true )) {
3332 throw std::runtime_error (" spin_some() called while already spinning" );
3433 }
34+ RCLCPP_SCOPE_EXIT (this ->spinning .store (false ); );
3535 while (rclcpp::utilities::ok () && spinning.load ()) {
3636 auto any_exec = get_next_executable ();
3737 execute_any_executable (any_exec);
You can’t perform that action at this time.
0 commit comments