Skip to content

Commit

Permalink
Rename setup_signal_handling_on_ios to setup_signal_handling_on_ioc
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Oct 17, 2024
1 parent 284bcd8 commit 24d85e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions application_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ void application_base::wait_for_signal(std::shared_ptr<boost::asio::signal_set>
});
}

void application_base::setup_signal_handling_on_ios(boost::asio::io_context& io_ctx, bool startup) {
void application_base::setup_signal_handling_on_ioc(boost::asio::io_context& io_ctx, bool startup) {
std::shared_ptr<boost::asio::signal_set> ss = std::make_shared<boost::asio::signal_set>(io_ctx, SIGINT, SIGTERM);
#ifdef SIGPIPE
ss->add(SIGPIPE);
Expand All @@ -168,7 +168,7 @@ void application_base::setup_signal_handling_on_ios(boost::asio::io_context& io_
void application_base::startup(boost::asio::io_context& io_ctx) {
//during startup, run a second thread to catch SIGINT/SIGTERM/SIGPIPE/SIGHUP
boost::asio::io_context startup_thread_io_ctx;
setup_signal_handling_on_ios(startup_thread_io_ctx, true);
setup_signal_handling_on_ioc(startup_thread_io_ctx, true);
std::thread startup_thread([&startup_thread_io_ctx]() {
startup_thread_io_ctx.run();
});
Expand All @@ -191,7 +191,7 @@ void application_base::startup(boost::asio::io_context& io_ctx) {

//after startup, shut down the signal handling thread and catch the signals back on main io_context
clean_up_signal_thread();
setup_signal_handling_on_ios(io_ctx, false);
setup_signal_handling_on_ioc(io_ctx, false);

#ifdef SIGHUP
std::shared_ptr<boost::asio::signal_set> sighup_set(new boost::asio::signal_set(io_ctx, SIGHUP));
Expand Down
2 changes: 1 addition & 1 deletion include/appbase/application_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ class application_base {
void print_default_config(std::ostream& os);

void wait_for_signal(std::shared_ptr<boost::asio::signal_set> ss);
void setup_signal_handling_on_ios(boost::asio::io_context& io_ctx, bool startup);
void setup_signal_handling_on_ioc(boost::asio::io_context& io_ctx, bool startup);

void handle_exception(std::exception_ptr eptr, std::string_view origin);
};
Expand Down

0 comments on commit 24d85e1

Please sign in to comment.