[*] Unix signal handlers shouldn't be Linux exclusive

This commit is contained in:
Reece Wilson 2022-04-07 06:31:38 +01:00
parent 1c78c18997
commit 9da2147756
2 changed files with 9 additions and 5 deletions

View File

@ -9,7 +9,10 @@
#include "Exit.hpp"
#include <Source/Grug/Grug.hpp>
#include "MTWatchDog.hpp"
#if defined(AURORA_IS_POSIX_DERIVED)
#include "Exit.Unix.hpp"
#endif
namespace Aurora::Exit
{
@ -64,6 +67,7 @@ namespace Aurora::Exit
static AuUInt32 gProblemCounter = {};
// Mitigate reused stack, nested try/catch, spam
if (level == ETriggerLevel::eProblematicEvent)
{
if (AuAtomicTestAndSet(&gProblemCounter, 1))
@ -101,7 +105,7 @@ namespace Aurora::Exit
gHasSentTerminate |= isTerminate;
}
// Force exit after calling the subscribers, should the even level be eSigTerminate
// Force exit after calling the subscribers, should the level be eSigTerminate
if (level == ETriggerLevel::eSigTerminate)
{
// HACK:
@ -149,14 +153,14 @@ namespace Aurora::Exit
gMutex = AuThreadPrimitives::MutexUnique();
InitWatchdog();
#if defined(AURORA_IS_LINUX_DERIVED)
#if defined(AURORA_IS_POSIX_DERIVED)
InitUnix();
#endif
}
void DeinitExit()
{
#if defined(AURORA_IS_LINUX_DERIVED)
#if defined(AURORA_IS_POSIX_DERIVED)
DeinitUnix();
#endif

View File

@ -121,7 +121,7 @@ namespace Aurora::IO::FS
return Loop::ELoopSource::eSourceFileWatcher;
}
// Event type is latching, not a type of binary semaphore
// Event type is latching, sort of like binary semaphore
// Resignal if work is still available
void NTEvent::OnPresleep()
{