Skip to content

Commit

Permalink
Fix comments in signal handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
Finomnis committed Dec 2, 2023
1 parent 9cbfd2b commit d261e7b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/signal_handling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,15 @@ async fn wait_for_signal_impl() {
let mut signal_shutdown = windows::ctrl_shutdown().unwrap();

tokio::select! {
_ = signal_c.recv() => tracing::debug!("Received CTRL_C_EVENT."),
_ = signal_break.recv() => tracing::debug!("Received CTRL_BREAK_EVENT."),
_ = signal_close.recv() => tracing::debug!("Received CTRL_CLOSE_EVENT."),
_ = signal_shutdown.recv() => tracing::debug!("Received CTRL_SHUTDOWN_EVENT."),
_ = signal_c.recv() => tracing::debug!("Received CTRL_C."),
_ = signal_break.recv() => tracing::debug!("Received CTRL_BREAK."),
_ = signal_close.recv() => tracing::debug!("Received CTRL_CLOSE."),
_ = signal_shutdown.recv() => tracing::debug!("Received CTRL_SHUTDOWN."),
};
}

/// Registers Ctrl+C and SIGTERM handlers to cause a program shutdown.
/// Further, registers a custom panic handler to also initiate a shutdown.
/// Otherwise, a multi-threaded system would deadlock on panik.
/// Registers signal handlers and waits for a signal that
/// indicates a shutdown request.
pub(crate) async fn wait_for_signal() {
wait_for_signal_impl().await
}

0 comments on commit d261e7b

Please sign in to comment.