12#include <condition_variable>
94 static
void handler(
int signal);
106 static std::condition_variable
cv_;
auto operator=(const scoped_signal_handler &) -> scoped_signal_handler &=delete
auto operator=(scoped_signal_handler &&) -> scoped_signal_handler &=delete
scoped_signal_handler(scoped_signal_handler &&)=delete
scoped_signal_handler(const scoped_signal_handler &)=delete
static void wait_for_shutdown()
Block until a shutdown signal is received.
static shutdown_callback callback_
Callback function.
static void install(shutdown_callback callback=nullptr)
Install signal handlers with optional callback.
static auto should_shutdown() noexcept -> bool
Check if shutdown has been requested.
static void handler(int signal)
Signal handler function for C signal API.
static void request_shutdown()
Request shutdown programmatically.
static std::condition_variable cv_
Condition variable for wait_for_shutdown.
static std::atomic< bool > callback_invoked_
Flag to prevent multiple callback invocations.
std::function< void()> shutdown_callback
Callback type for shutdown notification.
static void reset()
Reset the shutdown state.
static std::mutex mutex_
Mutex for condition variable.
static std::atomic< bool > shutdown_requested_
Shutdown flag.
std::shared_mutex mutex
Mutex for thread-safe access.