17#ifndef MUJOCO_ROS2_CONTROL__RENDER_LOOP_EXIT_HPP_
18#define MUJOCO_ROS2_CONTROL__RENDER_LOOP_EXIT_HPP_
23#include <rclcpp/context.hpp>
28inline bool handle_render_loop_exit(std::atomic<int>& exit_request,
29 const std::atomic<bool>& explicit_shutdown_requested,
30 const std::shared_ptr<rclcpp::Context>& context)
34 exit_request.store(1);
35 if (explicit_shutdown_requested.load())
40 return context && context->shutdown(
"MuJoCo rendering window closed");