From 9da2147756f9d4040a72e7497accf15cc0e9fd53 Mon Sep 17 00:00:00 2001 From: J Reece Wilson Date: Thu, 7 Apr 2022 06:31:38 +0100 Subject: [PATCH] [*] Unix signal handlers shouldn't be Linux exclusive --- Source/Exit/Exit.cpp | 12 ++++++++---- Source/IO/FS/Watcher.NT.cpp | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Source/Exit/Exit.cpp b/Source/Exit/Exit.cpp index e1fb0c7a..414eeaba 100644 --- a/Source/Exit/Exit.cpp +++ b/Source/Exit/Exit.cpp @@ -9,7 +9,10 @@ #include "Exit.hpp" #include #include "MTWatchDog.hpp" -#include "Exit.Unix.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 diff --git a/Source/IO/FS/Watcher.NT.cpp b/Source/IO/FS/Watcher.NT.cpp index b1fb7fb3..e8117676 100644 --- a/Source/IO/FS/Watcher.NT.cpp +++ b/Source/IO/FS/Watcher.NT.cpp @@ -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() {