AuroraRuntime/Include/Aurora/Exit/Exit.hpp
J Reece Wilson 1c78c18997 [+] Exit::CancelExit()
[*] Treat SIGTERM the same as SIGINT. SIGINT is somewhat of an arachic signal meaning, "hey dumb unix app, fuck the process group, start reading from stdin to listen to the user." Nowadays, this doesn't mean anything other than "hey, a human asked us to terminate from a TTY" - basically the same as SIGTERM, except SIGTERM is more likely to be a scheduled or otherwise expected shutdown event.
2022-04-07 06:22:50 +01:00

43 lines
1023 B
C++

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: Exit.hpp
Date: 2022-1-30
Author: Reece
***/
#pragma once
#include "ETriggerLevel.hpp"
#include "IExitSubscriber.hpp"
namespace Aurora::Exit
{
/**
* @brief Registers @param callback to the registry to subscribe to @param level events
* @param level
* @param callback
* @return
*/
AUKN_SYM bool ExitHandlerAdd(ETriggerLevel level, const AuSPtr<IExitSubscriber> &callback);
/**
* @brief Removes all exit handlers by pointer
* @param callback
* @return
*/
AUKN_SYM void ExitHandlerRemove(const AuSPtr<IExitSubscriber> &callback);
/**
* @brief Used from within callbacks to determine if the application is shutting down.
* @return
*/
AUKN_SYM bool IsAppRunning();
/**
* @brief Used from within eSigTerminate callbacks to prevent automatic shutdown of the application
* @return
*/
AUKN_SYM void CancelExit();
}