From a4108f59bd688b94ac3c99321edf21c58a7ec651 Mon Sep 17 00:00:00 2001 From: johannes Date: Mon, 9 Dec 2024 23:55:51 +0100 Subject: [PATCH] server: Adhere to naming conventions for shutdown_reasons --- examples/server/server.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/server/server.cpp b/examples/server/server.cpp index b3b321a4750c4..8b58a275b3c15 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -1164,15 +1164,15 @@ struct server_metrics { } }; -struct Signal { +struct termination_signal { int number; }; -struct StandbyTimeout {}; +struct standby_timeout {}; -using ShutdownReason = std::variant; +using shutdown_reason = std::variant; -std::function shutdown_handler; +std::function shutdown_handler; struct server_queue { int id = 0; @@ -1310,7 +1310,7 @@ struct server_queue { if (!condition_tasks.wait_for(lock, std::chrono::seconds(standby_timeout), pred)) { lock.release()->unlock(); // unlock the unique_lock, before calling the shutdown_handler, as it tries to lock it QUE_INF("%s", "stand-by timeout reached\n"); - shutdown_handler(StandbyTimeout{}); + shutdown_handler(::standby_timeout{}); break; } } else { @@ -2916,7 +2916,7 @@ inline void signal_handler(int signal) { exit(1); } - shutdown_handler(Signal{ signal }); + shutdown_handler(termination_signal{ signal }); } int main(int argc, char ** argv) { @@ -3956,7 +3956,7 @@ int main(int argc, char ** argv) { ctx_server.queue_tasks.on_update_slots(std::bind( &server_context::update_slots, &ctx_server)); - shutdown_handler = [&](ShutdownReason) { + shutdown_handler = [&](shutdown_reason) { ctx_server.queue_tasks.terminate(); };