Skip to content

Commit

Permalink
check thread whether joinable before join
Browse files Browse the repository at this point in the history
Signed-off-by: uupks <uupks0325@gmail.com>
  • Loading branch information
uupks committed Oct 4, 2022
1 parent 95837d3 commit 9b64591
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rclcpp/src/rclcpp/signal_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ SignalHandler::uninstall()
signal_handlers_options_ = SignalHandlerOptions::None;
RCLCPP_DEBUG(get_logger(), "SignalHandler::uninstall(): notifying deferred signal handler");
notify_signal_handler();
signal_handler_thread_.join();
if (signal_handler_thread_.joinable()) {
signal_handler_thread_.join();
}
teardown_wait_for_signal();
} catch (...) {
installed_.exchange(true);
Expand Down

0 comments on commit 9b64591

Please sign in to comment.